The dollar sign ($) in the attached PDF is replaced by a Thorn <http://en.wikipedia.org/wiki/%C3%9E> followed by a lowercase Y with diaeresis when converted by Ghostscript. The customer is using gs9.01 but other versions I've tried all behave the same way. Apple Preview and Adobe Acrobat display the expected dollar sign, but mu output matches ghostscript. The command line I'm using: bin/gs -sDEVICE=ppmraw -o test.ppm ./RF-6561.pdf Note that my attempts to simply the attached file using Acrobat have not been successful, the newly created files are all processed correctly by Ghostscript.
The sample file has incorrect appearance stream, which is faithfully displayed by Ghostscript. The appearance stream selects single-byte Helvetica font but, uses Unicode in the string data. Viewers, that show the file correctly, ignore appearance stream and re-create annotations from scratch. /Helv 10 Tf 0 g 2 3.3355 Td <FEFF010600320030002C003300320038002E00300030> Tj
Reassigning to Alex - Henry would like a fuller explanation of how/why we differ from Acrobat's output.
We render appearance stream. Adobe re-creates the appearance of the annotation from its attributes. Appearance stream and attributes don't match. I don't know a good approach to this problem. -- Always re-creating appearance streams is difficult. -- Detecting incorrect use of Unicode and replacing it with an appropriate encoding is silly. There are many other ways to break the file.
I've checked as many PDF viewers as I was able to find and here is the list of ones that display a '$': Adobe Acrobat Apple Preview Foxit Reader Nitro PDF Reader Google Chrome evince xpdf And these viewers display a thorn followed by a 'y' with diaeresis: Ghostscript mupdf
Created attachment 8531 [details] Shows Acrobat disobeying the PDF Spec
Regenerate appearance streams when it is requested by the file and implemented in PDF interpreter. (NeedAppearances is set) Otherwise, continue to use appearance streams provided by the file. The patch has been committed as http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=d252b4f9d3a949778894a86bb71cc2206fce11cf Regression testing shows some improvements in comparefiles/Bug689450.pdf but multi-line annotations are not yet implemented.