Search code examples
c#pdfwindows-10uwpmicrosoft-edge

Undocumented windows built-in PDF renderer capabilities?


Using the Windows.Data.Pdf namespace, i am able to render pdf (as an image) without using any third party library.

If im not mistaken, Microsoft's Edge browser uses the same library to render pdfs (Windows.Data.Pdf.dll). By looking at the official Windows.Data.Pdf documentation here i can see it's only about

converting a page in a Portable Document Format (PDF) document to an image file.

but, Edge browser has "search text" capability when rendering a pdf, which i cannot find anywhere in the Windows.Data.Pdf library.

My question is, is there any undocumented (hence unofficial) capabilities available to use in the Windows.Data.Pdf namespace (or somewhere else built-in in windows)? (Specifically, the search text function, which i assume i must be able to a) extract the text of pdf so i can search on it, and b) get the XY of the string occurence on the rendered page so i can highlight it somehow)


Solution

  • The library used by general Windows 10 apps is not the same as windows.data.pdf.dll, it's simply a namespace defined in Windows.Foundation.UniversalApiContract

    enter image description here

    On the other hand, Windows.Data.Pdf.dll is a native function library, so you need to see if you can get DllImport to work with it.

    EDIT: Here is the output of DependencyWalker of Windows.Data.Pdf.dll The function that interests you is probably PdfCreateRenderer

    enter image description here