Show / Hide Table of Contents

Class PdfDocumentSource

The source for a pdf document.

Inheritance
System.Object
PdfDocumentSource
PdfDocumentMergingSource
Implements
System.IDisposable
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Pdf
Assembly: Sartorius.SAF.Pdf.dll
Syntax
public class PdfDocumentSource : IDisposable

Constructors

View Source

PdfDocumentSource()

Initializes a new instance of the PdfDocumentSource class.

Declaration
protected PdfDocumentSource()
View Source

PdfDocumentSource(Byte[])

Initializes a new instance of the PdfDocumentSource class from a memory source.

Declaration
public PdfDocumentSource(byte[] content)
Parameters
Type Name Description
System.Byte[] content

The content.

Exceptions
Type Condition
System.ArgumentNullException

content is null.

View Source

PdfDocumentSource(Stream)

Initializes a new instance of the PdfDocumentSource class for a System.IO.Stream source.

Declaration
public PdfDocumentSource(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

The stream. The PdfDocumentSource becomes the owner of the stream.

Remarks

Do not dispose the stream. When loading a PdfDocument with LoadDocument() the loaded PdfDocument takes ownership of the stream and it will be disposed when the PdfDocument is disposed. When LoadDocument() is not called the PdfDocumentSource will dispose the stream.

Exceptions
Type Condition
System.ArgumentNullException

stream is null.

View Source

PdfDocumentSource(String)

Initializes a new instance of the PdfDocumentSource class for a file source.

Declaration
public PdfDocumentSource(string path)
Parameters
Type Name Description
System.String path

The path.

Exceptions
Type Condition
System.ArgumentNullException

path is null or empty.

Methods

View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
View Source

Dispose(Boolean)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

True if explicitly called from Dispose().

View Source

Equals(PdfDocumentSource)

Determines if another instance of PdfDocumentSource is equal to this instance.

Declaration
protected virtual bool Equals(PdfDocumentSource other)
Parameters
Type Name Description
PdfDocumentSource other

The other.

Returns
Type Description
System.Boolean
View Source

Equals(Object)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare with the current object.

Returns
Type Description
System.Boolean

true if the specified object is equal to the current object; otherwise, false.

Overrides
System.Object.Equals(System.Object)
View Source

GetHashCode()

Serves as a hash function for a particular type.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for the current object.

Overrides
System.Object.GetHashCode()
View Source

LoadDocument()

Loads the document.

Declaration
public virtual PdfDocument LoadDocument()
Returns
Type Description
PdfDocument

The PdfDocument loaded from the source.

Remarks

When using a System.IO.Stream the returned PdfDocument becomes the owner of the stream. This method can only be called once when using a stream.

Exceptions
Type Condition
System.InvalidOperationException

The document source was not specified

OR

The source is a System.IO.Stream and LoadDocument() has already been called once.

Operators

View Source

Equality(PdfDocumentSource, PdfDocumentSource)

Implements the operator ==.

Declaration
public static bool operator ==(PdfDocumentSource left, PdfDocumentSource right)
Parameters
Type Name Description
PdfDocumentSource left

The left.

PdfDocumentSource right

The right.

Returns
Type Description
System.Boolean

The result of the operator.

View Source

Inequality(PdfDocumentSource, PdfDocumentSource)

Implements the operator !=.

Declaration
public static bool operator !=(PdfDocumentSource left, PdfDocumentSource right)
Parameters
Type Name Description
PdfDocumentSource left

The left.

PdfDocumentSource right

The right.

Returns
Type Description
System.Boolean

The result of the operator.

Implements

System.IDisposable

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX