You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2010/12/11 18:09:02 UTC

[jira] Updated: (PDFBOX-854) PDPageContentStream.drawString() doesn't work with all PDFs

     [ https://issues.apache.org/jira/browse/PDFBOX-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-854:
--------------------------------------

    Attachment: Website_A4_Landscape_PDF14_addedText.pdf

I added some text to the given example using the new possibility to reset the graphics context of an existing content stream.


> 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.1
>         Environment: JDK 1.6.0_21
>            Reporter: MH
>         Attachments: Text_Added_With_iText.zip, Website_A4_Landscape_PDF14.zip, Website_A4_Landscape_PDF14_addedText.pdf
>
>
> 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.