Table of Contents

Method DocumentsAreEqual

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

DocumentsAreEqual(string, string)

Compares the data and structure of two not encrypted PDF documents.

public static bool DocumentsAreEqual(string firstFile, string secondFile)

Parameters

firstFile string

The name of the first PDF file.

secondFile string

The name of the second PDF file.

Returns

bool

true if documents are equal; otherwise false.

Remarks

This method is useful for regression tests when you compare two versions of the same document.

This method can only compare not encrypted files. To compare encrypted documents please use an overload that accepts parameter of PdfDecryptionHandler type.

This method ignores time-dependent document properties like CreationDate and ModifiedDate. Document metadata, trailer IDs and some other auto-generated properties are also get ignored.

DocumentsAreEqual(Stream, Stream)

Compares the data and structure of two not encrypted PDF documents.

public static bool DocumentsAreEqual(Stream firstDocument, Stream secondDocument)

Parameters

firstDocument Stream

The stream that contains the data for the first PDF document.

secondDocument Stream

The stream that contains the data for the second PDF document.

Returns

bool

true if documents are equal; otherwise false.

Remarks

This method is useful for regression tests when you compare two versions of the same document.

This method can only compare not encrypted files. To compare encrypted documents please use an overload that accepts parameter of PdfDecryptionHandler type.

The firstDocument and the secondDocument must be streams that allow reading and seeking. Otherwise, the method throws an exception of PdfException type.

This method ignores time-dependent document properties like CreationDate and ModifiedDate. Document metadata, trailer IDs and some other auto-generated properties are also get ignored.

DocumentsAreEqual(string, string, PdfDecryptionHandler)

Compares the data and structure of two PDF documents.

public static bool DocumentsAreEqual(string firstFile, string secondFile, PdfDecryptionHandler handler)

Parameters

firstFile string

The name of the first PDF file.

secondFile string

The name of the second PDF file.

handler PdfDecryptionHandler

The decryption handler to use to decrypt both files.

Returns

bool

true if documents are equal; otherwise false.

Remarks

This method is useful for regression tests when you compare two versions of the same document.

The method uses decryption handler specified by the handler parameter for both files. It's assumed that both files encrypted using the same encryption handler or both files are not encrypted at all.

This method ignores time-dependent document properties like CreationDate and ModifiedDate. Document metadata, trailer IDs and some other auto-generated properties are also get ignored.

DocumentsAreEqual(Stream, Stream, PdfDecryptionHandler)

Compares the data and structure of two PDF documents.

public static bool DocumentsAreEqual(Stream firstDocument, Stream secondDocument, PdfDecryptionHandler handler)

Parameters

firstDocument Stream

The stream that contains the data for the first PDF document.

secondDocument Stream

The stream that contains the data for the second PDF document.

handler PdfDecryptionHandler

The decryption handler to use to decrypt both streams.

Returns

bool

true if documents are equal; otherwise false.

Remarks

This method is useful for regression tests when you compare two versions of the same document.

The firstDocument and the secondDocument must be streams that allow reading and seeking. Otherwise, the method throws an exception of PdfException type.

The method uses decryption handler specified by the handler parameter for both files. It's assumed that both files encrypted using the same encryption handler or both files are not encrypted at all.

This method ignores time-dependent document properties like CreationDate and ModifiedDate. Document metadata, trailer IDs and some other auto-generated properties are also get ignored.

DocumentsAreEqual(Stream, Stream, PdfDecryptionHandler, PdfConfigurationOptions)

Compares the data and structure of two PDF documents.

public static bool DocumentsAreEqual(Stream firstDocument, Stream secondDocument, PdfDecryptionHandler handler, PdfConfigurationOptions options)

Parameters

firstDocument Stream

The stream that contains the data for the first PDF document.

secondDocument Stream

The stream that contains the data for the second PDF document.

handler PdfDecryptionHandler

The decryption handler to use to decrypt both streams.

options PdfConfigurationOptions

The configuration options.

Returns

bool

true if documents are equal; otherwise false.

Remarks

This method is useful for regression tests when you compare two versions of the same document.

The firstDocument and the secondDocument must be streams that allow reading and seeking. Otherwise, the method throws an exception of PdfException type.

The method uses decryption handler specified by the handler parameter for both files. It's assumed that both files encrypted using the same encryption handler or both files are not encrypted at all.

This method ignores time-dependent document properties like CreationDate and ModifiedDate. Document metadata, trailer IDs and some other auto-generated properties are also get ignored.