How to add .png images to pdf using Apache PDFBox
When I try to draw png images using pdfBox, the pages remain blank. Is there any way to insert png images using pdfBox? public void createPDFFromImage( String inputFile, String image, String outputFile ) throws IOException, COSVisitorException { // the document PDDocument doc = null; try { doc = PDDocument.load( inputFile ); //we will add the image to the first page. PDPage page = (PDPage)doc.getDocumentCatalog().getAllPages().get( 0 ); PDXObjectImage ximage = null; if( image.toLowerCase().endsWith( ".jpg" ) ) { ximage = new PDJpeg(doc, new FileInputStream( image ) ); } else if (image