PdfDocument.DocumentsAreEqual Method (Stream, Stream, String, PdfConfigurationOptions)

Docotic.Pdf Library Help > BitMiracle.Docotic.Pdf > PdfDocument Class > PdfDocument Methods > DocumentsAreEqual Method > DocumentsAreEqual Method (Stream, Stream, String, PdfConfigurationOptions)
Compares the data and structure of two PDF documents using specified configuration options.

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


public static bool DocumentsAreEqual(
	Stream firstDocument,
	Stream secondDocument,
	string password,
	PdfConfigurationOptions options
Public Shared Function DocumentsAreEqual ( 
	firstDocument As Stream,
	secondDocument As Stream,
	password As String,
	options As PdfConfigurationOptions
) As Boolean


Type: System.IO.Stream
The stream to read first PDF document to compare from.
Type: System.IO.Stream
The stream to read second PDF document to compare from.
Type: System.String
The password that unlocks PDF document with applied password security.
Type: BitMiracle.Docotic.Pdf.PdfConfigurationOptions
The configuration options.

Return Value

Type: Boolean
true if documents are equal; otherwise false


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

Password specified by the password parameter is used for both documents (it's assumed that both documents have the same password set or both documents have no password set). Please use empty string for password parameter if documents being compared are not protected with password.

Differences in CreationDate and ModifiedDate properties, document metadata and file trailer IDs of document being compared do not get taken into account.

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

See Also