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();

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.