Hi,
I am using below code to convert jpg to pdf. But I see that the resultant PDF file is empty with only water mark appended.
I have attached a sample file for which PDF is empty.
//Code snippet
Document pdfDocument = new Document();
Page page = pdfDocument.getPages().add();
pdfPage.getPageInfo().setHeight(imHeight);
pdfPage.getPageInfo().setWidth(imWidth);
pdfDocument.getPageSetup().setOrientation(PageFormat.LANDSCAPE);
Image image = new Image();
image.setImageStream(is);
pdfDocument.getPages().get_Item(1).getParagraphs().add(image);
page.getParagraphs().add(image);
pdfDocument.save(“C:/temp/ImagetoPDF.pdf”);
saveFile(workerServlet, pdfDocument, os);
Image-116.jpg (74.7 KB)