Aspose.PDF Poor image quality

Hi there, I am using Aspose.PDF to make a single page pdf file as new pdf with two page by separating its content. Everything works good except one thing:
Quality of extracted image is low. Here is code that use to extract image:
MemoryStream stream = new MemoryStream();
var img = doc.Pages[1].Resources.Images[2];
img.Save(stream);

Then I create Image Stamp from above image and insert it to new pdff file. At the end when I print the resulted pdf file I see that image has very poor quality than original. You can check that by using FileStream instead of MemoryStream to save image as file and check it(if you zoom in you will notice some fuzzy around text).

Attached package14.pdf is original pdf file and img1.jpg is extracted image.
package14.pdf
img1.jpg

Thanks
Khasan

@xasan2006

Thank you for contacting support.

I have worked with the data shared by you but have not been able to notice specified issue. Extracted image looks fine. Please explain low quality of extracted image with the help of a screenshot. Moreover, please ensure using Aspose.PDF for .NET 18.2 in your environment, and specify quality of an image stamp before adding it on a page. Value can be specified in percentage, as in the code below:

    imageStamp.Quality = 100;

In case the issue persists, please share a code snippet that you are using to add an image stamp, along with generated PDF file so that we may investigate further to help you out.

Hi Farhan.Raza, Thanks for response. I have attached source code of my app, original pdf file, result pdf file that my app produce, and result pdf file that 3 party app produce. I do not see major difference in the adobe acrobat reader but here is a huge difference when printing out, please look at Print_3rd_party_result.jpg and Print_my_result.jpg.

my_src.zip (33.6 KB)
package14.pdf (33.9 KB)
my_output.pdf (287.6 KB)
3-party-output.pdf (974.9 KB)
Print_3rd_party_result.jpg (257.7 KB)
Print_my_result.jpg (276.9 KB)

Thanks
Khasan

@xasan2006

Thank you for sharing requested data.

I have worked with the data shared by you. You have mentioned ‘result pdf file that 3 party app produce’ but the screenshots are comparing OXPS files. Please elaborate how can we reproduce this in our environment. Also, share the files that you are comparing in screenshots. Moreover, 3-party-output.pdf has been created by Aspose.PDF API as well. Please summarize the problem while sharing all relevant files. So that we may proceed to help you out.

Yes third party app uses Aspose.Pdf, but I don’t know how to produce same quality as they did with using Aspose.PDF. You can just print the my_output.pdf(previous attached file) and 3-party-output.pdf(previous attached file) to .OXPS file or to paper to compare/reproduce.
In my previous message I shared following files:
1)my_src.zip - my app’s source code
1)package14.pdf - this is original pdf file that need to be converted to two page
2)my_output.pdf - converted file that was produced with my app
3)3-party-output.pdf - converted file that was produced with 3-party app(it uses Aspose.PDF as well)
4)Print_3rd_party_result.jpg = screenshot of OXPS file that was printed from 3-party-output.pdf(Print to OXPS)
5)Print_my_result.jpg - screenshot of OXPS file that was printed from my_output.pdf(Print to OXPS)

Attached contains two OXPS files mine and 3rd party. Please zoom in as maximum as possible and you will notice that 3rdParty_output.oxps has good quality for text(more sharp and without fuzzy) and my_output.oxps has fuzzy
Printed.zip (478.0 KB)

@xasan2006

I have been able to reproduce the problem. Please explain the steps for reproducing 3-party-output.pdf file so that we may log this in our issue management system for further investigation and resolution.

Hi Farhan, To reproduce 3-party-output.pdf file you need to install the attached app. It is Amazon Label Printer app that converts A4 labels to 4x6 labels. Please run it, select package14.pdf(attached in previous message) as input file, select “Type 1” radio button and press “Print” button.

I think this is not an issue of Aspose.PDF as the 3rd party app uses the same component(Aspose.PDF) to produce good quality pdf file. The issue is I can not get same result with Aspose.PDF component, so I just want to ask help: May be I am doing something wrong? or I don’t use right api to produce image with good quality? So that’s why I sent you guys my source code, so you can check whether I used Aspose.pdf api right to convert pdf file

@xasan2006

I can not find any application attached with your post. Please note that the upload limit for a file on forums is 3 MB. If your application is bigger than 3 MB then please share it by uploading it to some file hosting server like Google Drive, Dropbox etc so that we may investigate further to help you out.

You can download attachment from my dropbox, here is link:
https://www.dropbox.com/s/rviy9ol1lwut1l1/setup_Amazon%20Label%20Printer_20171129_v1.0.zip?dl=0

@xasan2006

I have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-44273 has been logged in our issue management system for further investigation and resolution. The issue ID has been linked with this thread so that you will receive notification as soon as the issue is resolved.

The problem is not necessarily present in your code. 3rd party application is using an outdated version of Aspose.PDF API and it is not clear how are they working with input PDF file. This ticket has been logged for better, clearer and sharper images in a PDF file. We will let you know as soon as some significant progress will be made in this regard.

We are sorry for the inconvenience.

Thanks Farhan, Is there any chance to use old version?, Can you let me know what version are they used in app to make sharp, clear images? Currently my client bought license for Aspose.PDF component want to have same result as 3rd party app produces

@xasan2006

I would like to share with you that, 3rd party application is using Aspose.PDF for .NET 9.0 which is quite an old version of our API and you may find it difficult to work with this version as the API has been restructured and API references as well as API documentation is in accordance with latest version of API.

In case you want to expedite investigation and resolution of PDFNET-44273, you can consider Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQ.