PdfDocument.DocumentsAreEqual Method (Stream, Stream)

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

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
public static bool DocumentsAreEqual(
	Stream firstDocument,
	Stream secondDocument
)
VB
Public Shared Function DocumentsAreEqual ( 
	firstDocument As Stream,
	secondDocument As Stream
) As Boolean

Parameters

firstDocument
Type: System.IO.Stream
The stream that contains the data for the first PDF document.
secondDocument
Type: System.IO.Stream
The stream that contains the data for the first PDF document.

Return Value

Type: Boolean
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.

See Also