[
https://issues.apache.org/jira/browse/PDFBOX-5909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17901393#comment-17901393
]
Maksim commented on PDFBOX-5909:
--------------------------------
{code:java}
I use this code:
PDDocument doc = PDDocument.load(sourceDocument);
PDPage page = doc.getPage(0);
PDPageContentStream contents = new PDPageContentStream(doc, page,
PDPageContentStream.AppendMode.APPEND, false, true
);
File file = new File(ResourceUtils.getFile("classpath:fonts/" +
fontName).getAbsolutePath());
contents.beginText();
PDFont pdfFont = PDType0Font.load(doc,file );
contents.setFont(pdfFont, 50);
contents.newLineAtOffset(0,0);
contents.showText("Text");
contents.endText();
contents.close();{code}
> Text and image don't overlap on pdf created in Abbyy PDF Transformer +
> -----------------------------------------------------------------------
>
> Key: PDFBOX-5909
> URL: https://issues.apache.org/jira/browse/PDFBOX-5909
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.32, 3.0.3 PDFBox
> Reporter: Maksim
> Priority: Major
> Fix For: 2.0.33, 3.0.4 PDFBox
>
> Attachments: document (24) (1).pdf, image-2024-11-27-08-08-25-344.png
>
>
> I'm trying to insert text or a picture into pdf document (from attachment).
> PDF from attachment created in Abbyy PDF Transformer+.
> After inserting text or a picture, I get nothing as a result (the pdf remains
> empty).
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]