Free Support Forum - aspose.com

Java Util Class to convert multiple source formats to PDF output

I am planning to write a Util program in java which can take different source types like (RTF, TIFF’s) and Convert into PDF.



Do you have any util program which does this already? I also see code which says Optimized the PDF to web by calling optimize method. Any idea what this does?



We are working with huge Tiff files and any specific API method which can add value is deeply appreciated.

Hi Suresh,


Thank you for contacting support. You can create a blank document, insert an image, and then save in the PDF format using Aspose.Words API. You can also import an RTF, and then save in the PDF format. Please refer to these help topics: Convert an Image to PDF and Convert an RTF to PDF

Please let us know in case of any confusion or questions.

Thank you for the suggestion. It worked well for files with less size but with fewer more MB’s the process is slow. I emailed you the sample Java program but here are the version I use

  1.  aspose-words jar (version 17.2.0)
    
  2.  aspose-pdf jar version 10.9.0)
    

doc.save(baos,com.aspose.pdf.SaveFormat.Pdf);

this line takes 45+ mins to convert tiff file to PDF. BTW we get this tiff as inputstreams.

-Suresh

Downloaded the latest pdf jar 17.1.0 jar and this is what I see

Converting 100 MB tiff file to PDF to around 2 MB. And worst part is I get this error “Insufficient data for an image”. when I try to open the PDF.

Any help on this?

Hi Suresh,


Thank you for the details. You’re not applying license in the code. You can get a 30 day temporary license. It allows to test every aspect of the product before buying it. Please apply license once per application or process for each Aspose library. It is mandatory to apply the license for each single Aspose library by adding a couple of lines of code. Each Aspose library has the License class and you must initialize its object and set license file directory path explicitly or pass stream of the license file by calling setLicense method. Please note, the Aspose license should be applied before calling any Aspose library feature. Please refer to these help topics: Applying a License for Aspose.Words API and Applying a License for Aspose.Pdf API

However, if this does not help, then please send us your source documents. You can upload it to any free file sharer server (e.g., Dropbox and Google Drive) and then send its URL. We’ll investigate and reply you appropriately.

Thank you. Adding new license file helped.