Hi,

can absolutely no one help me??






KronosBB wrote:
> 
> Hi,
> 
> i have a problem by painting an Image to a pdf file. Here are some parts
> of my code:
> 
> Document document = new Document();
> File pdfDir = ...
> File outFile = File.createTempFile("test", ".pdf", pdfDir);
> outFile.deleteOnExit();
> PdfWriter writer = PdfWriter.getInstance(document, new
> FileOutputStream(outFile));
>                               
> document.open();
> PdfContentByte cb = writer.getDirectContent();
> java.awt.Graphics2D g2d = cb.createGraphicsShapes(PageSize.A4.width(),
> PageSize.A4.height());
> 
> for loop {
> 
>       if(true) {
>            g2d.dispose();
>            document.newPage();
>       }
> 
>       Image img = new ImageIcon(filename).getImage();
>       g2d.drawImage(img, x, y, width, height, null);
> }
> 
> 
> g2d.dispose();
> document.close();
> writer.close();
> 
> 
> I get an
> java.lang.IllegalArgumentException
>         at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
>         at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
>         at com.lowagie.text.pdf.PdfGraphics2D.drawImage(Unknown Source)
> 
> The last line in my code is "g2d.drawImage()".
> 
> Can someone help me? It is very urgent.
> 
> Thanks for help.
> KronosBB
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Image-problems-tf4854930.html#a13972840
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to