Hello to everyone,
i want to add jpgs to an PDDocument. This is my code:
PDDocument doc = new PDDocument;
PDPage page = new PDPage();
doc.addPage( page );
PDPageContentStream contentStream = new PDPageContentStream(doc, page);
PDXObjectImage ximage = null;
if( path.toLowerCase().endsWith( ".jpg" ) )
{
ximage = new PDJpeg(doc, new FileInputStream( "projects" + File.separator +
mainwin.getCurrentProject().getDirName() + File.separator + path ) );
}
contentStream.drawImage( ximage, 100, 700);
contentStream.close();
doc.close();
The page who will be added to the Document is empty. The file on the system
exists and with the file is ok. Where is my fault?
Best Regards,
Jochen Schreiber