I have some very simple code that:
1. Adds a watermark to a PDF document A (like explained
here - first kind) - the font I use is "Arial"
2. Then adds "cover pages" from another PDF document B
3. Adds bookmarks (outline) for the added "cover pages"
4. Save the result as PDF document C again
I tried to write unit tests for this code.
My idea was to add A, B and C as binary files, run the code in my unit test and then compare the results with my pre-existing version of "C".
That works just fine on my computer.
But when I run the same unit test in TeamCity (as part of our CI), the test fails and the created PDF document is indeed different.
When I compare the file to my local version (text compare), it seems that the binary contents are indeed very different. But I don't know why. My best guess is that the TeamCity server has different fonts installed and that this somehow affects the output (though I think it's a bit strange because I thought "Arial" should be the same on all Windows machines).
Anyway, what would be a good way to test this?
I don't have to do a binary comparison - if there was a way to extract the watermark from the output PDF somehow, then I could also check if the watermark text is what I expect it to be, etc.
Any suggestions?