PdfDocument.DocumentsAreEqual Method (Stream, Stream, String)

Note: This API is now obsolete.

Compares the data and structure of two PDF documents.

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

Syntax

C#
[ObsoleteAttribute("This method is obsolete and will be removed in the next version of the library. Please use one of the overloads with a parameter of PdfDecryptionHandler type instead.")]
public static bool DocumentsAreEqual(
	Stream firstDocument,
	Stream secondDocument,
	string password
)
VB
<ObsoleteAttribute("This method is obsolete and will be removed in the next version of the library. Please use one of the overloads with a parameter of PdfDecryptionHandler type instead.")>
Public Shared Function DocumentsAreEqual ( 
	firstDocument As Stream,
	secondDocument As Stream,
	password As String
) As Boolean

Parameters

firstDocument
Type: System.IO.Stream
The stream to read first PDF document to compare from.
secondDocument
Type: System.IO.Stream
The stream to read second PDF document to compare from.
password
Type: System.String
The password that unlocks PDF document with applied password security.

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.

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