Acrobat Reader and the decimal comma problem

Posted by berto on September 28, 2006

When printing a PDF file, Acrobat Reader creates a Postscript and sends it to the printer spooler (or, optionally to a file). Nothing new here, as it’s a common way for Unix programs to print files.

However, I found that under certain circumstances the Postscript file was corrupt: it could not be printed or opened with Ghostscript, because it showed instead an “undefined command” error.

Looking deeper into the problem I found that the corrupt file had its decimal numbers separated by a comma instead of a dot. The comma is the decimal separator in many locales, but decimal numbers in Postscript files must be separated by a dot.

Investigating a bit more I found that this problem shows when the Postscript file uses vector primitives, and that’s why the problem appears to occur randomly.

So the problem is that Acrobat Reader relies incorrectly on the locale settings to create a Postscript file. This should be a trivial bug to fix, but as Acrobat Reader is closed software you have to live with it if you want to use this software (fortunately free PDF readers are constantly improving).

There’s a quick workaround, however. As /usr/bin/acroread is really a shell script that lauches the real binary, you can add a export LC_NUMERIC=C at the beginning of the file and solve the problem. This bug is already fixed in some unofficial Debian packages.

Hope it helps.

Trackbacks

Trackbacks are closed.

Comments

Comments are closed.

  1. Jonas Kiselis Sat, 27 Jan 2007 14:45:07 CET

    I think that was an exeptional sitation.

  2. akae Tue, 02 Feb 2010 18:15:30 CET

    I was having a problem with spanish enviroment and a pdf with editable numeric fields. acroread was placing the dot and comma where he wanted, i.e. € 100.0,0000 (it should be 1.000,00) and this hint solved it in some way – now i have the dot placed correctly, and 5 decimal! 1.000,00000
    Lots of thanks!