Cannot use specific Pdf document.

Manoj Kumar 21 Reputation points
2022-09-20T08:18:57.227+00:00

Hi
I am using Windows.Data.Pdf.PdfDocument to load and save pdf's but for certain pdf we are not able to render using the native code. I have provided a sample that saves pdf's faulty rendered first page and save as image locally(Link for sample : **https://1drv.ms/u/s!AkHAdPCJCT87i107crOeHYGiPPyt?e=gOdBxf**.) I have also provided the pdf which is not rendered properly and image of faulty rendered and correctly rendered pdfs 242848-faulty-rendered.png`
242849-image.png

242857-literaturservice-herzklappentag.pdf

Do we have any work around for this type of pdf to render?

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Roy Li - MSFT 32,111 Reputation points Microsoft Vendor
    2022-09-20T10:02:42.157+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Do we have any work around for this type of pdf to render?

    First of all, yes, this behavior is related to these kind of PDF file. These PDF files might use some PDF features that the native UWP API does not support. So the PDF API can't render the blue part of the Page.

    Currently, a workaround for this is to convert the specific PDF file to a new PDF file by browser. You could open your PDF file in Edge and printed it as a new PDF file. This might convert the blue part of the PDF file into a big image which could be rendered by the PDF API. So when opening the new PDF file, the app could generate the image correctly.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful