Hi Good day,
Prasad
Hi Good day,
Hi Prasad,
// instantiate Document object<o:p></o:p>
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
// add page to PDF file
doc.getPages().add();
// create Image object
com.aspose.pdf.Image img = new com.aspose.pdf.Image();
// load TIFF image
img.setFile(myDir+"Duane.jpg");
// add image to paragraphs collection of first page
doc.getPages().get_Item(1).getParagraphs().add(img);
// save resultant PDF
doc.save(myDir+"IMGDOM.PDF");
Hi Good evening,
metropolitanhealth:Hi Good evening,Could you pls provide some feedback for the issue we have raised earliler with regarding .jpg conversion to PDF.Below is the ticket number : PDFNEWJAVA-34775and thread link : metropolitanhealth:
metropolitanhealth:we are still having issues with certain jpg files.Pls find the attached files that has .jpg files with in the email attachment.we are also having .TIF file conversion issues,pls find one sample one that failed in PRODUCTION
Hi good day,
Hi Prasad,
The issues you have found earlier (filed as PDFNEWJAVA-34775) have been fixed in Aspose.Pdf for Java 10.3.0.
Hi Good day,
Hi Prasad,
// instantiate Document object<o:p></o:p>
com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
// add page to PDF file
doc.getPages().add();
// create Image object
com.aspose.pdf.Image img = new com.aspose.pdf.Image();
// load TIFF image
img.setFile(myDir+"prod4.JPGF");
// add image to paragraphs collection of first page
doc.getPages().get_Item(1).getParagraphs().add(img);
// save resultant PDF
doc.save(myDir+"prod4_IMGDOM.PDF");
Best Regards,
Hi good day,
I have tried your DOM Approach,
<o:p></o:p>
Your response will be appreciated,
Kind Regards,Prasad
metropolitanhealth:
I have tried your DOM Approach,pls check below code as i am currently tested://New version using DOM approachprivate static void convertImageToPdf(String inFilepath, String pdfFilepath,FileType fileType)throws XPdfConvert {LOG.info(" Converting Image To Pdf using DOM Approach .... " );ByteArrayInputStream srcStream = null;ByteArrayOutputStream dstStream = new ByteArrayOutputStream();byte[] inbytesArray = null;try {inbytesArray = FileUtils.readFileToByteArray(new File(inFilepath));srcStream = new ByteArrayInputStream(inbytesArray);Pdf pdf1 = new Pdf();// instantiate Document objectcom.aspose.pdf.Document doc = new com.aspose.pdf.Document();// add page to PDF filedoc.getPages().add();com.aspose.pdf.Image img1 = new com.aspose.pdf.Image();img1.setImageStream(srcStream);//add image to paragraphs collection of first pagedoc.getPages().get_Item(1).getParagraphs().add(img1);pdf1.save(dstStream);LOG.info(" Converted Image To Pdf by ASPOSE Successfully " );} catch (Exception e) {LOG.error("Failed to convert Image to PDF... Error message: "+e.getMessage()+". Error cause: "+e.getCause());throw new XPdfConvert(String.format("message=\"Failed to convert Image file To PDF '%s'\"", inFilepath),e);}}Pls assist with this ASAP as this is a PROD issue.
metropolitanhealth:Pls send me the converted pdf's that you have mentioned that it was working with my JPEG files attached earlier.
metropolitanhealth:The code snippet that you have given earlier is the one i shared some time before which was not working.so bit confused.Your code:// instantiate Document objectcom.aspose.pdf.Document doc = new com.aspose.pdf.Document();// add page to PDF filedoc.getPages().add();// create Image objectcom.aspose.pdf.Image img = new com.aspose.pdf.Image();// load TIFF imageimg.setFile(myDir+"prod4.JPGF");// add image to paragraphs collection of first pagedoc.getPages().get_Item(1).getParagraphs().add(img);// save resultant PDFdoc.save(myDir+"prod4_IMGDOM.PDF");We are still waiting tiff issue related to TIF image conversion. (PDFNEWJAVA-34838), related to TIF image conversion.Your response will be appreciated,
Kind Regards,Prasad
Hi Good day,
with regarding PDFNEWJAVA-34838,did you guys made any progress on this.<o:p></o:p>
Pls let me know once u have solution that fix converting certain tiff files that failed as per my email earlier.
Your response will be appreciated.
Thank you once again for the suppport.
kind regards,
Prasad
metropolitanhealth:Thank your the assistance by pointing to right piece of code for JPEG conversion with latest apose.pdf jar and i have tested JPEG files which are failed earlier?
metropolitanhealth:with regarding PDFNEWJAVA-34838,did you guys made any progress on this.
Pls let me know once u have solution that fix converting certain tiff files that failed as per my email earlier.
In reference to PDFNEWJAVA-34838, the issue is still not resolved. Our product team has completed initial investigation and planning for the resolution. We will notify you as soon as we made some significant progress towards issue resolution.
Thanks for your patience and cooperation.
Best Regards,
Hi Good day,
metropolitanhealth:Hi Good day,Sorry for the confusion,I mean to say issue with JPEG files was resolved with new DOM Approach.Just waiting for the solution for TIFF image conversion.Hi Prasad,Please note that the issue reported earlier as PDFNEWJAVA-34838 is regarding TIFF to PDF conversion, whereas the previously reported issue was related to JEPG to PDF conversion.As shared by Tilal, as soon as we have we have made some definite progress towards the resolution of TIFF image to PDF conversion, we will let you know.
The issues you have found earlier (filed as PDFNEWJAVA-34838) have been fixed in Aspose.Pdf for Java 11.4.0.