Free Support Forum - aspose.com

Converting Kit.PdfConverter.Resolution from Aspose.Pdf.Ket 5.5.0 to Facades.PdfConverter 7.1.0

Hi,

I am converting an existing application from version 5.5.0 to the new combined version 7.1 and am having an issue with the .Resolution property. My existing code uses the Aspose.Pdf.Kit library and simply sets the TIFF resolution to 300 dpi as follows

PdfConverter.Resolution = 300

as found in the support article http://www.aspose.com/docs/display/pdfnet/Convert+PDF+File+to+Single+TIFF+Image+using+Settings+%28Facades%29

However, under the new Facades.PdfConverter version, this property no longer accepts an integer value and is looking for a Devices.Resolution object that does not produce the same resulting TIFF file. What is the proper way to upgrade this property to the latest version ?

Regards,

Doug Kemp

Hi Doug,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

In Aspose.Pdf.Facades, as you mentioned, you will need Aspose.Pdf.Devices.Resolution object for setting the resolution. Please see the following sample code:

//create PdfConverter object and bind input PDF file

PdfConverter pdfConverter = new PdfConverter();

Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

pdfConverter.Resolution = resolution;

pdfConverter.BindPdf("input.pdf");

pdfConverter.DoConvert();

We will update our documentation accordingly. Also, as you mentioned that you are not getting proper results when you are using Aspose.Pdf.Devices.Resolution class, I would request you to share the template PDF file and resultant tiff images to show the difference / issues. We will look into it and get back to you soon.

Sorry for the inconvenience,

Hi Nausherwan,

I have attached the source PDF and 4 .TIF formatted files. The files named 8201.TIF and 8202.TIF were created with Pdf.kit and convert as expected. The files named 5800.TIF and 5801.TIF are created with the Pdf library version 7.2.

I have also attached the VB code snippet I use to process the input PDF into TIF's

Regards,

Doug Kemp

Hi Doug,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am working on your query and I will get back to you.

Sorry for the inconvenience,

Hi Nausherwan,

Have you had a chance to follow up on my rendering problem? I need to work out the problem wityh the new library before I can deploy an update needed in our production environment.

Regards,

Doug Kemp

Hi Doug,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Sorry for delay in response.

I am able to generate your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: PDFNEWNET-34166. You will be notified via this forum thread regarding any updates against your reported issue.

Sorry for the inconvenience,

Hi Doug,


Thanks for your patience.

We have further investigated this issue and have observed that there has been a breaking change in API with new Aspose.Pdf product as compare to Aspose.Pdf.Kit. Please note that the method pdfConverter.SaveAsTIFF() now accepts page dimensions but not resolution.

so please use following method overload to fix the issue:

pdfConverter.SaveAsTIFF(outFile,
Aspose.Pdf.Devices.CompressionType.CCITT4);
<o:p></o:p>

[VB.NET]

'create PdfConverter object and bind
input PDF file
<o:p></o:p>

Dim pdfConverter As New PdfConverter()

Dim resolution As Aspose.Pdf.Devices.Resolution = New Aspose.Pdf.Devices.Resolution(300)

pdfConverter.Resolution = resolution

pdfConverter.BindPdf("D:\pdftest\000365-12.pdf")

pdfConverter.DoConvert()

'create TiffSettings object

Dim tiffSettings As New Aspose.Pdf.Devices.TiffSettings()

'convert to TIFF image

pdfConverter.SaveAsTIFF("D:\pdftest\000365-12_output.tif", Aspose.Pdf.Devices.CompressionType.CCITT4)

pdfConverter.Close()

Hi Nayyer,

In your code snippet, you created a TiffSettings object but I did not see where you were setting any properties to that object -or- passing it in the SaveAsTIFF method.

Can you help me understand the purpose and use of the TiffSettings object?

Regards,
Doug Kemp

Hi Doug,


The TiffSettings class is used when we need to convert PDF pages into TIFF format using TiffDevice class. As in your scenario, you are using PdfConverter to render PDF file into TIFF image, you the instantiation of TiffSettings object is not required. You may please skip/comment out that line. Sorry for the confusion.

For further details on how to use TiffSettings class, you may consider visiting the following link Convert all PDF pages to single TIFF Image

Nayyer,

One last question - Is there an advantage using the TiffDevice class (one page at a time) v.s. the pdfConverter class I was using?

Regards,
Doug Kemp

Hi Doug,


TiffDevice is a new approach which was introduced since the release of Merged release version of Aspose.Pdf for .NET. As per our observations, TiffDevice is better in performance and results as compare to PdfConverter.

The issues you have found earlier (filed as PDFNEWNET-34166) have been fixed in Aspose.Pdf for .NET 7.5.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan