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
Returns
- bool
trueif documents are equal; otherwisefalse.
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.
It is required to apply your license key(s) before using this method. Call one of the AddLicenseData methods to apply the keys. Without a valid license key, this method throws an exception of InvalidOperationException type.
To test the library, get a free time-limited license key using the form on the Download C# .NET PDF library page.
DocumentsAreEqual(Stream, Stream)
Compares the data and structure of two not encrypted PDF documents.
public static bool DocumentsAreEqual(Stream firstDocument, Stream secondDocument)
Parameters
firstDocumentStreamThe stream that contains the data for the first PDF document.
secondDocumentStreamThe stream that contains the data for the second PDF document.
Returns
- bool
trueif documents are equal; otherwisefalse.
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.
It is required to apply your license key(s) before using this method. Call one of the AddLicenseData methods to apply the keys. Without a valid license key, this method throws an exception of InvalidOperationException type.
To test the library, get a free time-limited license key using the form on the Download C# .NET PDF library page.
DocumentsAreEqual(string, string, PdfDecryptionHandler)
Compares the data and structure of two PDF documents.
public static bool DocumentsAreEqual(string firstFile, string secondFile, PdfDecryptionHandler handler)
Parameters
firstFilestringThe name of the first PDF file.
secondFilestringThe name of the second PDF file.
handlerPdfDecryptionHandlerThe decryption handler to use to decrypt both files.
Returns
- bool
trueif documents are equal; otherwisefalse.
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.
Check the Decrypt PDF documents in C# and VB.NET article for more information on processing encrypted PDF documents.
It is required to apply your license key(s) before using this method. Call one of the AddLicenseData methods to apply the keys. Without a valid license key, this method throws an exception of InvalidOperationException type.
To test the library, get a free time-limited license key using the form on the Download C# .NET PDF library page.
DocumentsAreEqual(Stream, Stream, PdfDecryptionHandler)
Compares the data and structure of two PDF documents.
public static bool DocumentsAreEqual(Stream firstDocument, Stream secondDocument, PdfDecryptionHandler handler)
Parameters
firstDocumentStreamThe stream that contains the data for the first PDF document.
secondDocumentStreamThe stream that contains the data for the second PDF document.
handlerPdfDecryptionHandlerThe decryption handler to use to decrypt both streams.
Returns
- bool
trueif documents are equal; otherwisefalse.
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.
Check the Decrypt PDF documents in C# and VB.NET article for more information on processing encrypted PDF documents.
It is required to apply your license key(s) before using this method. Call one of the AddLicenseData methods to apply the keys. Without a valid license key, this method throws an exception of InvalidOperationException type.
To test the library, get a free time-limited license key using the form on the Download C# .NET PDF library page.
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
firstDocumentStreamThe stream that contains the data for the first PDF document.
secondDocumentStreamThe stream that contains the data for the second PDF document.
handlerPdfDecryptionHandlerThe decryption handler to use to decrypt both streams.
optionsPdfConfigurationOptionsThe configuration options.
Returns
- bool
trueif documents are equal; otherwisefalse.
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.
Check the Decrypt PDF documents in C# and VB.NET article for more information on processing encrypted PDF documents.
Read the Font loading in cloud environments section for an example of using configuration options.
It is required to apply your license key(s) before using this method. Call one of the AddLicenseData methods to apply the keys. Without a valid license key, this method throws an exception of InvalidOperationException type.
To test the library, get a free time-limited license key using the form on the Download C# .NET PDF library page.