Hi I am trying to insert an image into a PDF file but it throws a document has no pages error.

 

Here is my code snipet. I am creating this page in a JSP because I am using a bean to pull info out of a DB.

 

PdfWriter.getInstance(document, new FileOutputStream("../webapps/slb/" + myUrlString + ".pdf"));             

document.open();

 

/TRYING TO ADD IMAGE!!!

                          // document.add(new Paragraph("new_logo2.png"));  //This line adds the name of the image to the pdf file

                    //Image png = Image.getInstance("new_logo2.png"); //This line gives me document has no page

                            //document.add(Image.getInstance("new_logo2.png"));             

                           //  Image img = Image.getInstance("new_logo2.png");

 

Thanks for any assistance you can provide.

 

Tanya

 

 

                       

Reply via email to