4.7.  Comparing Document Properties

You might want to compare the title or other document information of two PDF documents. Use the following tags:

<!-- Tags to compare document properties: -->

<haveSameAuthor           />
<haveSameCreationDate     />
<haveSameCreator          />
<haveSameKeywords         />
<haveSameLanguage         />
<haveSameModificationDate />
<haveSameProducer         />
<haveSameProperties       />
<haveSameProperty         />
<haveSameSubject          />
<haveSameTitle            />

As an example of comparing any document property we compare the author:

<testcase name="haveSameAuthor">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameAuthor />
  </assertThat>
</testcase>

Custom properties can be compared using the tag <haveSameProperty />:

<testcase name="haveSameCustomProperty">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameProperty name="Company"/>
    <haveSameProperty name="SourceModified"/>
  </assertThat>
</testcase>

Of course, you can use this tag to compare all standard properties.

If you want to compare all properties of two documents, you can use the tag <haveSameProperties />:

<testcase name="haveSameProperties_AllProperties">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameProperties />
  </assertThat>
</testcase>