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

Free Support Forum - aspose.com

Highlight Annotations rendering oddly when converting Pdf Document to images

Hi!

I’m trying to render a PDF document to PNGs. When the PDF has any kind of highlight annotation, the text behind it is jagged and aliased. Is there anything I can do to correct this?

Thanks!

– Geoff

Hi Geoff,

Thanks for using our products.

You may check the following documentation links for details and code snippets as per your requirement.

Convert particular PDF page to PNG Image

Convert all PDF pages to PNG Images

Working with Annotations

Please do let us know if you need any further assistance.

Thanks & Regards,

Rashid,

Thanks - I am actually working with code identical to that in the first example, but when there are highlights in the PDF, they end up looking jagged and aliased.

I’ve attached a section of the PNG that it renders, and here is a link to the original file:

https://www.adobe.com/support/products/pdfs/adobe_products_and_windows_vista.pdf

The highlights were made in Acrobat.

Hi Geoff,

Thanks for your request, highlighted text in the PDF Document will not be jagged after conversion to PNG by using the below code.

Document pdfDocument = new Document("adobe.pdf");

using (FileStream imageStream = new FileStream("image.png", FileMode.Create))
{
//create PNG device with specified attributes

//Width, Height, Resolution, Quality

//Quality [0-100], 100 is Maximum

//create Resolution object

Resolution resolution = new Resolution(700);

PngDevice pngDevice = new PngDevice(resolution);

//convert a particular page and save the image to stream

pngDevice.Process(pdfDocument.Pages[1], imageStream);

//close stream

imageStream.Close();
}

Please do let us know if you need any further assistance.

Thanks & Regards,

Rashid,


We are still having many problems with our pdf conversions. We went ahead and created a few pdfs that contain all of the problems we are having. I have attached the following with explanations below:

  • Attachment 1.pdf
    • This is a control pdf, it has no annotations.
  • Attachemtn 2.pdf
    1. The original pdf file that we made with all of the problems (2.pdf)
      1. HighlightAnnotation
      2. SquareAnnotation
      3. CircleAnnotation
      4. PopupAnnotation
      5. FreeTextAnnotation
    2. The png output from the conversion when using Aspose.Pdf.Document with this method: http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/convert-particular-pdf-page-to-png-image.html (2-Pdf.Document.png)
      1. HighlightAnnotation - Very grainy and bold
      2. SquareAnnotation - Not rendered
      3. CircleAnnotation - Faded, moved up, and moved right
      4. PopupAnnotation - Faded, grainy, and bold
      5. FreeTextAnnotation - Faded, moved up, moved right, lost background color
    3. The png output from the conversion when using Aspose.Pdf.Kit.PdfConverter with this method: http://www.aspose.com/documentation/.net-components/aspose.pdf.kit-for-.net/aspose.pdf.kit.pdfconverter.doconvert_overload_1.html (1-PdfConverter.png)
      1. HighlightAnnotation - Opaque and covers text
      2. SquareAnnotation - Not rendered
      3. CircleAnnotation - Moved up and moved right
      4. PopupAnnotation - Opaque and covers text
      5. FreeTextAnnotation - Moved up and moved right
  • Attachment 3.pdf (3-Pdf.Document.png, 3-PdfConverter.png)
    • We made this file to show you how PdfConverter and Document misplaces Annotations. This occurs mostly for shapes and freetext. As you can see the the line of circles gets moved up, moved right, AND spread out (notice they overlap in the original).
  • Attachment 4.pdf (4-Pdf.Document.png, 4-PdfConverter.png)
    • Using Pdf.Document conversion, the image in this pdf is rendered as a black box.
  • Another problem we have seen is that random PopupAnnotations make their way back into the converted pngs after being deleted from the original pdf.
Rashid, we really need to get each and EVERY one of these problems figured out as soon as we can.
Please escalate this if need be.

Thank you,

Nathan Edwards
Software Developer
Innovative Data Solutions

ASPOSE Support,

Do you have an update on this issue? It has been almost a week since Nathan posted the documentation on this issue and we have not heard anything yet. Any feedback on your progress would be greatly appreciated.

Heath

Hi Heath,

Sorry for the delayed response.

I have tested the scenario and I am able to notice the same problem. For the sake of correction, I have logged this problem as PDFNEWNET-31925 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction.

We apologize for your inconvenience.

Thanks & Regards,

Hi Matt,

Our development team is working on your issue. However, as per your email, I have requested an ETA from the development team regarding PDFNEWNET-31925 and as soon as I get a response from them, I will be happy to update you. Please spare some time with us.

We apologize for your inconvenience.

Thanks & Regards,

Rashid,

Just wanted to find out if you got any sign of an ETA on this issue yet.

Regards,
Matt Lavoie

Hi Matt,

I am very sorry for the inconvenience caused due to this issue. However, I would like to share with you that we are discussing and investigating this issue at our end. Our development team is trying to provide the fix the earliest possible. Please spare us some time, so we could provide some estimate for the availability of the fix.

Thanks & Regards,

Rashid,

I do believe it has been a reasonable amount of time to expect an ETA, at the very least. Please let me know if any progress has been made on this issue. We need to get this bug resolved.

Thank you,
Matt

Hi Matt,

Thank you for being patient. I got an ETA regarding your issue from our development team and hopefully, we will provide you the fix for this issue by January 2012. Please be patient and spare us time to fix your issue.

We apologize for your inconvenience.

Thanks & Regards,

Rashid,

I hope you had a happy new year. I know it is still early in January but I was just wanting to get a more exact date with which we could expect the solution for this issue.

Thank you,
Matt

Hi Matt,

Thank you for being patient.

The issue has been resolved by the development team and this issue will be a part of Aspose.Pdf for .NET v6.6 (to be released in current month) after following the complete testing and release cycle. Please be patient and we will notify you once the version is available for download.

Sorry for the inconvenience,

Thanks & Regards,

The issues you have found earlier (filed as PDFNEWNET-31925) have been fixed in this update.


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

Rashid,

I sent you an e-mail yesterday regarding updates with this issue, please confirm that you received it.

Jelani Jackson
Junior Software Developer
Innovative Data Solutions

Hi Jelani,

Thanks for using our products. However, I am unable to find any email from your side. Please note that we encourage forum support as compare to email, so I request you to please post your query within this forum thread, if your data is confidential, you may mark this thread as private by clicking the "Make Private" button available on the top of every forum post or by checking "Keep this post as private" checkbox at the bottom when replying to the post, this way only Aspose staff and you would be able to see your attachments.

We are really sorry for this inconvenience.

Thanks & Regards,

Hello Jelani,

For your convenience, I have marked this forum thread as private.

Now concerning to the issue PDFNEWNET-31925, please note that this issue was fixed in our earlier release of Aspose.Pdf for .NET 6.6.0. However I would recommend you to please try using our latest release version of Aspose.Pdf for .NET 6.8.0 and in case you still face any issue or you have any further query, please feel free to contact. We are really sorry for your inconvenience.

Hey, you actually locked Jelani (and everyone else) out of this thread: they can’t view it or reply to anything in it.

Hi Geoff,

Sorry for the inconvenience.

I have made the thread public again. Now, you will be able to see your post. Regarding the issue reported by Jelani, I have replied in the following thread.

Thank You & Best Regards,