[ 
https://issues.apache.org/jira/browse/PDFBOX-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919209#action_12919209
 ] 

MH commented on PDFBOX-854:
---------------------------

I tried to trick PDFBox: I called my method 2 times in hope that the first call 
will embed the font and the second call would be sure that the used font is 
embedded in the PDF. Here's the result:

1. it didn't help, i.e. the text is still not display. => it seems that the 
problem is not, that the used font for the additional text is not already 
embedded in the destination PDF.

2. after the first call, the font is embedded in the destination PDF. The 
second call loads this PDF and will embed the font A SECOND TIME in the result 
PDF! So the result PDF after the second call shows 2 times the same font as 
embedded (viewed with Acrobat Reader). Then I checked all my PDFs (concatenated 
and postprocessed with PDFBox) and noticed that after each postprocessing 
status, the fonts get duplicated again and again! => another bug?

> PDPageContentStream.drawString() doesn't work with all PDFs
> -----------------------------------------------------------
>
>                 Key: PDFBOX-854
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-854
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.3.0
>         Environment: JDK 1.6.0_21
>            Reporter: MH
>         Attachments: Website_A4_Landscape_PDF14.zip
>
>
> I add custom text to misc exsiting PDF files. Now I wondered why my text 
> doesn't appear for a specific PDF. It is not encrypted, has the same page 
> size and adding Text with iText 2.1.7 works as expected. My code to add text 
> is:
> ----------------------------------
>                             final PDPage page = (PDPage) allPages.get(i);
>                             final PDPageContentStream contentStream = new 
> PDPageContentStream(doc, page, true, false);
>                             contentStream.beginText();
>                             contentStream.setFont(font, sizeOfFont);
>                             contentStream.moveTextPositionByAmount(xf, yf);
>                             contentStream.drawString(text);
>                             contentStream.endText();
>                             contentStream.close();
> ---------------------------------
> I tried to find differences between this PDF and other PDFs. What I noticed: 
> the PDF where I can't see the text has a PDF-Version "1.3" and was created by 
> "AFPL Ghostscript 8.54". Is there some known issue with PDFBox and such 
> "older" PDF formats?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to