You should really complain to the PDFRenderer developers. Either they don't support jpeg (I don't believe it) or you jpeg is broken. Jpeg doesn't have any processing by iText, it goes into the PDF as-is.
Paulo > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of pepwallace > Sent: Friday, April 18, 2008 8:49 AM > To: [email protected] > Subject: Re: [iText-questions] Image desn´t appear when > viewing PDF with PDFRenderer > > > I solved it ! > > First I created a com.lowagie.text.Image object by this way: > > ... > String pathToImg = "c:\\tmp\logo.jpg"; > Image logoImg = Image.getInstance(pathToImg); > ... > > And I was getting the ArrayIndexOutOfBoundsException > exception when printing > or viewing the PDF with PDFRender. > > java.lang.ArrayIndexOutOfBoundsException: 766 > at > com.sun.pdfview.colorspace.IndexedColor.<init>(IndexedColor.java:72) > at > com.sun.pdfview.colorspace.PDFColorSpace.getColorSpace(PDFColo > rSpace.java:154) > > > > The solution is to create first a AWT Image and pass it to > the getInstance > method of com.lowagie.text.Image : > > String pathToImg = "c:\\tmp\logo.jpg"; > java.awt.Image awtImage = > Toolkit.getDefaultToolkit().createImage(pathToImg); > logoImg = Image.getInstance(awtImage, null); > > > > > pepwallace wrote: > > > > > > I know that the bug is from PDFRenderer code but I have > generated the same > > PDF with FOP and I can print the PDF ok with PDFRenderer ... > > > > > > pepwallace wrote: > >> > >> Hi there, > >> > >> > >> > >> I have generated a PDF with iText. It has a header and a table. The > >> header has a 3 column table, and I have inserted an image > in the first > >> one. First I inserted the image in a Pragraph, and then > tried it with a > >> Chunk. In both cases, I can see the image in the generated PDF with > >> Acrobat Reader, but if I try to open or print the document with > >> PdfRenderer (https://pdf-renderer.dev.java.net/) the image des not > >> appear. > >> > >> > >> > >> Furthermore, in the other 2 header columns I have some > text. If I put an > >> image in the first column, the text in the second and third column > >> doesn´t appear when I view it with PDFRenderer (although > it's generated > >> ok with iText). If I don´t put the image in the first > column, the I can > >> see the text in the other 2 columns. > >> > >> > >> > >> Has anyone generated an image in a header with iText and > then can see it > >> with PDFRenderer ? I 'm using it to print the PDF directly > from my java > >> application. > >> > >> > >> > >> Thanks a lot ! Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Do you like iText? Buy the iText book: http://www.1t3xt.com/docs/book.php Or leave a tip: https://tipit.to/itexttipjar
