We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Performance Concerns for TIFF to PDF Conversion

Hi Babar,

Need your support again. Regarding the same concern, I am facing two issues now,
1. Tiff to PDF conversion is taking way much time. With the attached file, it took 17 mins to convert. User is not happy with this as other conversion tools take very less time compared to this.
2. The size of the converted PDF is also huge which is also a concern as user is accessing those files remotely and viewing takes considerable amount of time. The converted size for the attached file is more than 15 MB whereas the original tiff file size is only 1.5 MB…

Could you please check at your end and see if it behaves similarly in your system and provide some assistance to overcome above two issues.

Thanks,
Wasim

Hi Wasim,


Thank you for contacting Aspose support.

Plesase note, we have split your existing thread to create a new one on your behalf in Aspose.Total support forum because your recent concerns involve two Aspose APIs, that are; Aspose.Imaging & Aspose.Pdf for Java. Please allow us some time to evaluate your concerns on our side, and get back to you with updates in this regard.

Below provided is the code snippet that we have suggested your earlier for TIFF to PDF conversion.

Java

TiffImage multiImage = (TiffImage) Image.load(<>);
int frameCounter = 0;
for (TiffFrame tiffFrame : multiImage.getFrames())
{
JpegOptions jpgCreateOptions = new JpegOptions();
jpgCreateOptions.setResolutionSettings(tiffFrame.getFrameOptions().getResolutionSettings());
tiffFrame.save(<>, jpgCreateOptions);

Pdf pdf1 = new Pdf();
Section sec1 = pdf1.getSections().add();
aspose.pdf.Image img1 = new aspose.pdf.Image(sec1);
sec1.getParagraphs().add(img1);
img1.getImageInfo().setFile(<>);
pdf1.save(<>);
}

Itsak26:
1. Tiff to PDF conversion is taking way much time. With the attached file, it took 17 mins to convert. User is not happy with this as other conversion tools take very less time compared to this.
Hi Wasim,

Thanks for contacting support.

I have tested the above stated scenario using Aspose.Pdf for Java 10.1.0 and I am able to reproduce the same problem that TIFF to PDF conversion is taking around 12 minutes to complete the process. For the sake of correction, I have logged it in
our issue tracking system as PDFNEWJAVA-34791.
Itsak26:
2. The size of the converted PDF is also huge which is also a concern as user is accessing those files remotely and viewing takes considerable amount of time. The converted size for the attached file is more than 15 MB whereas the original tiff file size is only 1.5 MB…
I have also observed that when converting TIFF image to PDF format using following code snippet, the resultant PDF of 52MB is being generated. I have separately logged it as PDFNEWJAVA-34792. We
will further investigate these issues in details and will keep you updated on the status
of a correction.

We apologize for your inconvenience.


[Java]

com.aspose.pdf.Document doc = new com.aspose.pdf.Document();

doc.getPages().add();

com.aspose.pdf.Image image = new com.aspose.pdf.Image();

image.setFile("c:/pdftest/200001999.tif");

doc.getPages().get_Item(1).getParagraphs().add(image);

doc.save(<span style=“font-size:10.0pt;line-height:115%;font-family:Consolas;mso-fareast-font-family:
“Malgun Gothic”;mso-fareast-theme-font:minor-fareast;color:#2A00FF;mso-ansi-language:
EN-US;mso-fareast-language:KO;mso-bidi-language:AR-SA”>“c:/pdftest/200001999_converted.pdf”);

Hi,

Is there any update on the above issues?

Thanks,
Wasim

Hi Wasim,


As we recently have been able to notice these issues, and until or
unless we have investigated and have figured out the actual reasons of these problems, we might not be able to share any timelines by which they will
be resolved.<o:p></o:p>

However, as soon as we have made some significant progress towards their resolution, we would be more than happy to update you with the status of correction. Please be patient and spare us little time. Your patience and comprehension is greatly appreciated in this regard.

Hi,

Just wanted to check if there is an update on the issue.
Can Aspose throw an exception if it is taking longer time than lets say 5 minutes so that main program can suspend this task for the time being?
Please let me know.

Thanks,
Wasim

Hi Wasim,


Thanks for your patience.

Both the issues reported earlier are still pending for review and they are not yet resolved. As soon as we have some further updates, we will let you know

Itsak26:
Can Aspose throw an exception if it is taking longer time than lets say 5 minutes so that main program can suspend this task for the time being?
Hi Wasim,

Your request has been shared with product team and they will see if this feature can be implemented or not. We will keep you posted on the status of implementation.

Hi,

Is there any update on the performance issue or the time out exception? We really need this sooner as our testing phase already started. Please update.

Thanks
Wasim

Hi Wasim,


Thanks for your patience.

I am afraid the earlier reported issue regarding too much time taken by API to perform TIFF to PDF conversion is still pending for review as the team has been busy fixing previously reported high priority issues. The team will surely consider fixing this issue according to their development schedule. As soon as we have any further updates, we will let you know.

Hi,

The issue is not only the time taken and the size of the converted PDF file, the process is eating too much of RAM and records high CPU utilization ( almost 100%) during the time it processes the multi image TIFF files which is not acceptable. Please note that I have set JVM configuration to maximum supported 1024M in 32 bit server but still it takes up too much of CPU usage.

If a full fledged solution can’t be provided for now, please provide a work around to deal with the situation. It’s been few months now and we didnt get any progress from you.

Thanks,
Wasim


Hi Wasim,


Please note that during my testing, I did not notice extensive CPU and RAM utilization during conversion process. However I have recorded these concerns with already reported PDFNEWJAVA-34791 and have intimated the team to consider this point during the investigation process.

Furthermore, the time and resources taken by API to complete an operation depends upon the structure and complexity of input files and also please note that issues are resolved in first come first serve basis as we believe its the fairest policy to all the customers.

Hi,

Where can we see the status of the tickets PDFNEWJAVA-34791 and
PDFNEWJAVA-34792 reported earlier?

Thanks,
Wasim

Hi Wasim,


Thanks for your inquiry. I am afraid your reported issues are still not resolved, as our product team is busy in investigating/fixing other issues in the queue, reported earlier. However we have raised the issue priority of your above reported issues and requested our product team to complete the analysis and share ETA at their earliest. We will notify you as soon as we made some significant progress towards issues’ resolution.

We are sorry for the inconvenience caused.

Best Regards,

Thanks for the info.
Is there a way to scale down the resolution of the TIFF files such as to reduce the pixel quality to avoid the longer processing?
I was searching the APIs but there are no javadocs or any documentation attached. Can you please provide a link or doc for the Imaging APIs for Java at least?

Thanks,
Wasim

Hi Wasim,

You can use TiffOptions to scale down the resolution or quality of TIFF files. Please check [TiffOptions Configuration](http://www.aspose.com/docs/display/imagingjava/TiffOptions+Configuration) for more details and let us know if you see any issue.

Best Regards,

Hi Wasim,


Thanks for your patience. In reference to PDFNEWJAVA-34792, you may us setBlackWhite() property to change TIFF image to black and white color format. It will improve the processing time and reduce the document size as well. Your shared TIFF image conversion results into 1.7 Mb PDF document.

com.aspose.pdf.Document doc = new
com.aspose.pdf.Document();<o:p></o:p>

doc.getPages().add();

com.aspose.pdf.Image image = new com.aspose.pdf.Image();

image.setFile(myDir+"200001999.tif");

image.setBlackWhite(true);

doc.getPages().get_Item(1).getParagraphs().add(image);

doc.save(myDir+"200001999_converted_bw.pdf");


Please feel free to contact us for any further assistance.


Best Regards,

Hi,

Thanks for the solution.!! Will it work for multi-pages tiff as well?
Could you please share the converted PDF.

Thanks,
Wasim

Hi Wasim,


The earlier shared code snippet can be used for single frame or multi-frame TIFF image. Please try using our API’s and in case you encounter any issue, please feel free to contact.
Hi Wasim,

Itsak26:
Hi,

Thanks for the solution.!! Will it work for multi-pages tiff as well?
Could you please share the converted PDF.

Thanks,
Wasim

In addition to above reply, please find required sample output for your reference.

Please feel free to contact us for any further assistance.

Best Regards,