开发者

Spacing between Itext PDF fonts is incorrect

I'm using itext(2.x) to create pdfs.

Locally on my computer, the pdf output is correct.

But when i run the code on the production server, running ubuntu, the spacing between characters in the fonts is w开发者_Python百科rong.

Anyone have any experience from a similar situation ?


You need to install the used fonts on your server.


I Strongly Suspect this is a font issue.

Possibility 1: The font you're using simply isn't present on the server (VSU's answer). This will cause the font in question to default back to Helvetica... which will Look Wrong.

Possibility 2: You're not embedding the font and are viewing the PDF on a different system than the one that generated it. If both machines have a font named "Arial", but there are subtle (or not so subtle) differences, the character spacing could look Way Off.

Possibility 3: You're "baking" kerning info into your app, which is wrong for the version (or font, cross-talk with possibility 1 here) that ends up in the PDF.

There's probably another couple varients I'm not thinking of that could be The Problem, but that covers every scenario I've run into in my 14 years as a PDF Guy.

PS: You could talk all the guesswork out of this if you'd post links to your PDFs... one from your dev box and an "identical" one from the server.


Not sure if there's anyone still looking ta this, but I have the same problem.

I'm using itext to generate a PDF - and it looks good when I test it locally but when printed off the server, the alignment is off. On comparison, one notices that the font sizes are slightly smaller in the server version of the file.

What makes it more interesting is that if I copy the file off the servers print spooler /var/spool/cups/ to my local machine, It views and prints OK.

I'm now trying to use itext to embed fonts in my PDF to see if it will help, but is there anything else I can try?


Itext 2.x is VERY old. Are you still using Windows 95 as well?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜