xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tor-Einar Jarnbjo <tor-ei...@jarnbjo.name>
Subject bfrange entries in PDFToUnicodeCMap obviously incorrect
Date Fri, 22 Oct 2010 20:48:35 GMT
Hi,

when generating PDF files with a bfrange entry in the ToUnicode 
parameter, it is not possible to copy text from a PDF file when it is 
opened in Acrobat Reader. Selecting the text is possible, but the actual 
copy action causes Acrobat Reader to show an error message, that an 
error has occured.

I first thought the problem to be related to this Ghostscript bug:

http://bugs.ghostscript.com/show_bug.cgi?format=multiple&id=691272

(Acrobat reader does not work if the low and high indexes have leading 
zeros), but patching PDFToUnicodeCMap to create two-digit entries for 
indexes < 256 even for multibyte fonts did not work either. Acrobat 
Reader did not fail completely when copying the text, but characters 
within the ranges were not copied correctly. Pasting the copied text 
into a text editor caused the non-range characters to come out properly, 
but the characters within the declared ranges come out as garbage.

Reading through the specification for the ToUnicode parameter, it is not 
obvious to me what FOP is doing wrong here (the Ghostscript bug mentions 
a bug in Acrobat Reader), but as long as the probably most used PDF 
reader is buggy here, wouldn't it be reasonable not to use the range 
feature? After patching the partOfRange method to always return false 
solved all problems and text seems to be copy & pasteable without 
restrictions. The drawback is of course that the generated attribute may 
be slightly larger.

Regards,
Tor



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message