4.20. Further Comparisons

In the previous chapters a lot of examples show how to compare various parts of two PDF documents. But PDFUnit provides more tags for comparing PDF. The following list shows the remaining tags. They should be self explanatory:

<!-- Various tags to compare 2 PDF documents, not described before: -->

<areBothForFastWebView />
<haveSameKeywords      />                       
<haveSameLanguage      />
<haveSameLayerNames    />
<haveSameTrappingInfo  />
<haveSameTaggingInfo   />

Here are two examples:

Fast WebView, Tagging

<testcase name="compareFastWebView_BothNO">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <areBothForFastWebView />
  </assertThat>
</testcase>
<testcase name="haveOfTaggingInfo">
  <assertThat testDocument="test/test.pdf"
              masterDocument="master/master.pdf"
  >
    <haveSameTaggingInfo />
  </assertThat>
</testcase>

Combination of tests

All tests can be combined into one test:

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

It's hard to find a good name for this test. So it's better to write three smaller tests.