Hi,

I'm having some issues opening my PDF in Adobe Reader. It's a simple PDF
which has several PDFPTables and then a couple of images with some
information on them. Here's some code:

file = new File("/Users/chrishowell/HotelFaxLayout.pdf");

                        PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream(file));

                        document.open();

                        PdfContentByte cb = writer.getDirectContent();

                        cb.beginText();

                        loadImages(document);
                        topInfoTable(fonturl, cb);

                        drawRectangles(cb);

                        reservationDetailsTable(fonturl, fonturlbold, cb);

                        paymentInstructionsTable(fonturl, fonturlbold, cb);

                        companyVATTable(fonturl, cb);

                        cb.endText();

                        cb.stroke();

                        document.close();


Each of the methods with "Table" in the name are just PDFTables containing
text, and the loadImages method does the following:

Image png = Image.getInstance("/Users/chrishowell/ClickLogoBW.png");

                png.setAbsolutePosition(mmToPoints(10), mmToPoints(270));
                png.scaleToFit(mmToPoints(80), mmToPoints(15));

                document.add(png);

                
                        // Card Back
                        Image cardBack = 
Image.getInstance("/Users/chrishowell/CardBack.png");
                        cardBack.setAbsolutePosition(mmToPoints(111.25f), 
mmToPoints(20));

                        cardBack.scaleToFit(mmToPoints(85), mmToPoints(54));
                        document.add(cardBack);

                        // Card Front
                        Image cardFront = 
Image.getInstance("/Users/chrishowell/CardFront.png");
                        cardFront.setAbsolutePosition(mmToPoints(111.25f), 
mmToPoints(76.5f));
                        cardFront.scaleToFit(mmToPoints(85), mmToPoints(54));
                        document.add(cardFront);

                        // signature
                        Image signature = 
Image.getInstance("/Users/chrishowell/photo2.jpg");
                        signature.setAbsolutePosition(mmToPoints(124.25f), 
mmToPoints(46.5f));
                        // cardFront.scaleToFit(mmToPoints(85), mmToPoints(54));
                        document.add(signature);
                


Everything seems to work fine until I put information on top of the images
I've drawn. What I mean is I am generating a virtual card for payment. So I
have some card template backgrounds I display on the screen. When I put
information onto this card e.g. card number / expiry date , my PDF generates
fine but when I open it in Adobe Reader I get the following error: 

"An error exists on this page. Acrobat may not display the page correctly.
Please contact the person who created the PDF document to correct the
problem."

The PDF displays fine so I don't know what is causing this error to pop up.
The only thing I can think of is somehow some of my PdfPTables are too close
together on the card? None of them overlap, but it just seems to be
complaining about this information. If i remove the card info the page works
fine.

Anybody ever come across any Adobe related issues?

Thanks,

Chris



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Itext-not-working-with-Adobe-Reader-tp4656855.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to