Sorry If I am missing something obvious, but I am unable to get am image to render on the page.
This is what I have so far. This is what I have managed to construct from Google and the javadoc.
In the DrawInlineImagePlain it has creator.transform() and creator.perform() but the javadoc does no
help me understand those parts. Thanks.
PDImage pdImage = (new ImageConverterAwt2Pdf( (BufferedImage)ImageIO.read(new File("Jane.png")))).getPDImage();
CSCreator creator = CSCreator.createNew(page);
FileLocator locator = new FileLocator("test.pdf");
I get a blank PDF.
That should be easy. Your PDF only looks blank because the image is so small. Every image is 1x1 pixels internally in PDF. You need to apply a tranformation before drawing the image. Like this:
creator.transform(400, 0, 0, 400, 0, 0); // or whatever numbers you need
Thanks a bunch for the fast reply. I really appreciate this.
I am sorry to ask another question, but I cannot for the life of me figure out how to move the image to a diffrent location. That is te method to do this?
That's also "transform". Read up on the PDF operator "cm" in the spec if you want to know more about that. The javadoc for class java.awt.AffineTransform might help, too. Or any article about geometry transformations.
Log in to post a comment.