com.pdfunit.validators

## Class CompareDocumentValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.AbstractPageValidator
    - - com.pdfunit.validators.CompareDocumentValidator

-     @DoNotObfuscate
      public final class CompareDocumentValidator
      extends com.pdfunit.validators.AbstractPageValidator

  Validator to compare properties of two PDF documents which are related to a complete document. See `ComparePageValidator` if you want to compare properties which are related to pages.
  Since:
    2016.05
  Author:
    Carsten Siedentop, February 2016
  See Also:
    `ComparePageValidator`

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.validators.AbstractPageValidator

      `effectedPageNumbers, pageScanFlag, pagesToUse, region`

    - ### Fields inherited from class com.pdfunit.validators.AbstractValidator

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CompareDocumentValidator(DocumentValidator documentValidatorTest, DocumentValidator documentValidatorMaster)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeDocument()` Close PDF document.
    `CompareDocumentValidator` | `haveSameAccessPermission()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameAccessPermission(AccessPermission permissionToCompare)` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameAppearance()` This method renders each specified page of a test PDF document and compares it as an image to the same area of a master PDF.
    `ComparePageValidator` | `haveSameAppearance(PagesToUse pagesToUse)` Deprecated.
    `ComparePageValidator` | `haveSameAppearance(PagesToUse pagesToUse, PageRegion region)` Deprecated.
    `CompareDocumentValidator` | `haveSameAuthor()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameBookmarks()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameCreationDate()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameCreator()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameEmbeddedFiles(ComparedBy comparedBy)` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameFieldsByName()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameFieldsByValue()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameFormat()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameFormat(PagesToUse pagesToUse)` Deprecated.
    `CompareDocumentValidator` | `haveSameImages()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameImages(PagesToUse pagesToUse)` Deprecated.
    `CompareDocumentValidator` | `haveSameJavaScript()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameKeywords()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameLanguageInfo()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameLayerNames()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameModificationDate()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNamedDestinations()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfBookmarks()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfEmbeddedFiles()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfFields()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfImages()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfImages(PagesToUse pagesToUse)` Deprecated.
    `CompareDocumentValidator` | `haveSameNumberOfLayers()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfNamedDestinations()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfPages()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameNumberOfTaggingInfo()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameProducer()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameProperties()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameProperty(java.lang.String property)` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameSubject()` This method does what the name suggests.
    `CompareDocumentValidator` | `haveSameTaggingInfo()`
    `ComparePageValidator` | `haveSameText()`
    `ComparePageValidator` | `haveSameText(PagesToUse pagesToUse)` Deprecated.
    `ComparePageValidator` | `haveSameText(PagesToUse pagesToUse, PageRegion region)` Deprecated.
    `ComparePageValidator` | `haveSameText(PagesToUse pagesToUse, PageRegion region, WhitespaceProcessing whitespaceProcessing)` Deprecated.
    `ComparePageValidator` | `haveSameText(PagesToUse pagesToUse, WhitespaceProcessing whitespaceProcessing)` Deprecated.
    `CompareDocumentValidator` | `haveSameTitle()` This method does what the name suggests.
    `CompareXFAValidator` | `haveXFAData()` This method does what the name suggests.
    `CompareXMPValidator` | `haveXMPData()` This method does what the name suggests.
    `ComparePageValidator` | `restrictedTo(PagesToUse pagesToUse)` This method sets a page filter for the following validation process.

    - ### Methods inherited from class com.pdfunit.validators.AbstractPageValidator

      `createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion`

    - ### Methods inherited from class com.pdfunit.validators.AbstractValidator

      `equals, getDocument, hashCode`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CompareDocumentValidator

          protected CompareDocumentValidator(DocumentValidator documentValidatorTest,
                                  DocumentValidator documentValidatorMaster)

  - ### Method Detail

    - #### closeDocument

          public void closeDocument()

      Description copied from class: `com.pdfunit.validators.AbstractValidator`
      Close PDF document.
      Overrides:
        `closeDocument` in class `com.pdfunit.validators.AbstractValidator`

    - #### haveSameAccessPermission

          public CompareDocumentValidator haveSameAccessPermission()

      This method does what the name suggests.

    - #### haveSameAccessPermission

          @Guarded
          public CompareDocumentValidator haveSameAccessPermission(AccessPermission permissionToCompare)

      This method does what the name suggests.

    - #### haveSameAppearance

          public CompareDocumentValidator haveSameAppearance()

      This method renders each specified page of a test PDF document and compares it as an image to the same area of a master PDF. Both documents must have the same format.

    - #### haveSameAppearance

          @Guarded
          @Deprecated
          public ComparePageValidator haveSameAppearance(PagesToUse pagesToUse)

      Deprecated.
      This method renders each specified page of a test PDF document and compares it as an image to the same area of a master PDF. Both documents must have the same format.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameAppearance(pagesToUse)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameAppearance()`.

    - #### haveSameAppearance

          @Deprecated
          @Guarded
          public ComparePageValidator haveSameAppearance(PagesToUse pagesToUse,
                                                                   PageRegion region)

      Deprecated.
      This method renders areas from each specified page of a test PDF document and compares it as an image to the same area of a master PDF. Both documents must have the same format.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameAppearance(pagesToUse, region)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).restrictedTo(region).haveSameAppearance()`.

    - #### haveSameAuthor

          public CompareDocumentValidator haveSameAuthor()

      This method does what the name suggests.

    - #### haveSameBookmarks

          public CompareDocumentValidator haveSameBookmarks()

      This method does what the name suggests.

    - #### haveSameCreationDate

          public CompareDocumentValidator haveSameCreationDate()

      This method does what the name suggests.

    - #### haveSameCreator

          public CompareDocumentValidator haveSameCreator()

      This method does what the name suggests.

    - #### haveSameNamedDestinations

          public CompareDocumentValidator haveSameNamedDestinations()

      This method does what the name suggests.

    - #### haveSameEmbeddedFiles

          @Guarded
          public CompareDocumentValidator haveSameEmbeddedFiles(ComparedBy comparedBy)

      This method does what the name suggests.

    - #### haveSameFieldsByName

          public CompareDocumentValidator haveSameFieldsByName()

      This method does what the name suggests.

    - #### haveSameFieldsByValue

          public CompareDocumentValidator haveSameFieldsByValue()

      This method does what the name suggests.

    - #### haveSameFormat

          public CompareDocumentValidator haveSameFormat()

      This method does what the name suggests.

    - #### haveSameFormat

          @Deprecated
          @Guarded
          public CompareDocumentValidator haveSameFormat(PagesToUse pagesToUse)

      Deprecated.
      This method does what the name suggests.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameFormat(pagesToUse)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameFormat()`.

    - #### haveSameImages

          public CompareDocumentValidator haveSameImages()

      This method does what the name suggests.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameImages(pagesToUse)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameImages()`.

    - #### haveSameImages

          @Deprecated
          @Guarded
          public CompareDocumentValidator haveSameImages(PagesToUse pagesToUse)

      Deprecated.
      This method does what the name suggests.

    - #### haveSameJavaScript

          public CompareDocumentValidator haveSameJavaScript()

      This method does what the name suggests.

    - #### haveSameKeywords

          public CompareDocumentValidator haveSameKeywords()

      This method does what the name suggests.

    - #### haveSameLanguageInfo

          public CompareDocumentValidator haveSameLanguageInfo()

      This method does what the name suggests.

    - #### haveSameLayerNames

          public CompareDocumentValidator haveSameLayerNames()

      This method does what the name suggests.

    - #### haveSameModificationDate

          public CompareDocumentValidator haveSameModificationDate()

      This method does what the name suggests.

    - #### haveSameNumberOfBookmarks

          public CompareDocumentValidator haveSameNumberOfBookmarks()

      This method does what the name suggests.

    - #### haveSameNumberOfEmbeddedFiles

          public CompareDocumentValidator haveSameNumberOfEmbeddedFiles()

      This method does what the name suggests.

    - #### haveSameNumberOfFields

          public CompareDocumentValidator haveSameNumberOfFields()

      This method does what the name suggests.

    - #### haveSameNumberOfImages

          public CompareDocumentValidator haveSameNumberOfImages()

      This method does what the name suggests.

    - #### haveSameNumberOfImages

          @Deprecated
          @Guarded
          public CompareDocumentValidator haveSameNumberOfImages(PagesToUse pagesToUse)

      Deprecated.
      This method does what the name suggests.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameNumberOfImages(pagesToUse)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameNumberOfImages()`.

    - #### haveSameNumberOfLayers

          public CompareDocumentValidator haveSameNumberOfLayers()

      This method does what the name suggests.

    - #### haveSameNumberOfNamedDestinations

          public CompareDocumentValidator haveSameNumberOfNamedDestinations()

      This method does what the name suggests.

    - #### haveSameNumberOfPages

          public CompareDocumentValidator haveSameNumberOfPages()

      This method does what the name suggests.

    - #### haveSameNumberOfTaggingInfo

          public CompareDocumentValidator haveSameNumberOfTaggingInfo()

      This method does what the name suggests.

    - #### haveSameProducer

          public CompareDocumentValidator haveSameProducer()

      This method does what the name suggests.

    - #### haveSameProperties

          public CompareDocumentValidator haveSameProperties()

      This method does what the name suggests.

    - #### haveSameProperty

          @Guarded
          public CompareDocumentValidator haveSameProperty(java.lang.String property)

      This method does what the name suggests.

    - #### haveSameSubject

          public CompareDocumentValidator haveSameSubject()

      This method does what the name suggests.

    - #### haveSameTaggingInfo

          public CompareDocumentValidator haveSameTaggingInfo()

    - #### haveSameText

          public ComparePageValidator haveSameText()

    - #### haveSameText

          @Deprecated
          @Guarded
          public ComparePageValidator haveSameText(PagesToUse pagesToUse)

      Deprecated.
      This method checks that two documents have the same text in the given pages and regions.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameText(pagesToUse)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameText()`.

    - #### haveSameText

          @Deprecated
          @Guarded
          public ComparePageValidator haveSameText(PagesToUse pagesToUse,
                                                             WhitespaceProcessing whitespaceProcessing)

      Deprecated.
      This method checks that two documents have the same text in the given pages and regions.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameText(pagesToUse, whitespaceProcessing)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).haveSameText(whitespaceProcessing)`.

    - #### haveSameText

          @Deprecated
          @Guarded
          public ComparePageValidator haveSameText(PagesToUse pagesToUse,
                                                             PageRegion region)

      Deprecated.
      This method checks that two documents have the same text in the given pages and regions.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameText(pagesToUse, region)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).restrictedTo(region).haveSameText()`.

    - #### haveSameText

          @Deprecated
          @Guarded
          public ComparePageValidator haveSameText(PagesToUse pagesToUse,
                                                             PageRegion region,
                                                             WhitespaceProcessing whitespaceProcessing)

      Deprecated.
      This method checks that two documents have the same text in the given pages and regions.

      Instead of `AssertThat.document(filename1).and(filename2).haveSameText(pagesToUse, region, whitespaceProcessing)` use `AssertThat.document(filename1).and(filename2).restrictedTo(pagesToUse).restrictedTo(region).haveSameText(whitespaceProcessing)`.

    - #### haveSameTitle

          public CompareDocumentValidator haveSameTitle()

      This method does what the name suggests.

    - #### haveXFAData

          public CompareXFAValidator haveXFAData()

      This method does what the name suggests.

    - #### haveXMPData

          public CompareXMPValidator haveXMPData()

      This method does what the name suggests.

    - #### restrictedTo

          @Guarded
          public ComparePageValidator restrictedTo(PagesToUse pagesToUse)

      This method sets a page filter for the following validation process.

Copyright (C) PDFUnit.com. See here for license.