I have an automated process that generates pdfs which we then compare to a known version via approval tests to verify nothing in that pipeline is broken. I normalize mismatching fields like created/modified date and timezone and locally everything always matches up 100%. However for some reason, pdfs generated on our build server are very different from those I generate locally with sometimes the ones I generate locally being as much as 20% larger.
The first difference when comparing the files in winmerge is the /FontName
field which looks like this:
Locally Generated
/FontName/QOAAAA+TimesNewRomanRegular
Build Server Generated
/FontName/QYAAAA+TimesNewRomanRegular
after that we have differences in /FontBBox
, length, and binary data. I see several blocks of this.
My suspicion is that slightly different fonts are available on and being selected on the two machines and being embedded into the pdf but I have not idea what the Q*AAAA
code above means nor how to verify that hypothesis.
Edit:
pdffonts reports identical fonts in both but couldn't that just be different versions of the same embedded font?
W:\xpdfbin-win-3.03\bin64> .\pdffonts.exe w:\...\PhantomRasterizer\Can_rasterize_html_to_pdf.slide_with_table_and_svg.approved.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
TimesNewRomanRegular CID TrueType yes no yes 7 0
ArialBold CID TrueType yes no yes 12 0
ArialRegular CID TrueType yes no yes 17 0
W:xpdfbin-win-3.03\bin64> .\pdffonts.exe W:\...\PhantomRasterizer\Can_rasterize_html_to_pdf.slide_with_table_and_svg.received.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
TimesNewRomanRegular CID TrueType yes no yes 7 0
ArialBold CID TrueType yes no yes 12 0
ArialRegular CID TrueType yes no yes 17 0