0

Hi

PLEASE HELP

I have a problem with my PDFBox API.
I am currently getting a PDF Document and then I want to add a string at location
0,0, when i try to save it , it is not saving the changes and it remains as it is.


The Following is the code used:

PDPage page = (PDPage) allPages.get(f);
                        System.out.println(page);
                        PDRectangle pageSize = page.findMediaBox();
                        float stringWidth = font.getStringWidth( ab );
                        float centeredPosition = (pageSize.getWidth() - (stringWidth*fontSize)/1000f)/2f;

                        PDPageContentStream contentStream = new PDPageContentStream(pdoc,page,true,true);
                        contentStream.beginText();
                        contentStream.setFont( font, fontSize );
                        //contentStream.addLine(10, 10, 10, 10);
                        contentStream.moveTextPositionByAmount(0 , 0);
                        contentStream.drawString( ab );
                        contentStream.endText();
                        contentStream.close();

                        pdoc.save("C:/1/1.pdf");
                        pdoc.close();
1
Contributor
1
Reply
4
Views
6 Years
Discussion Span
Last Post by Bozog
0

The problem is not with the code that I am using

The problem is that what generate the PDFs is generating them in a V 1.2 format.

So I need to see if there is any solution for a V1.2 report

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.