Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 212
Sharky Avatar asked Sep 15 '15 09:09

Sharky


2 Answers

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

like image 133
Kanadaj Avatar answered Oct 23 '22 21:10

Kanadaj


Sorry for the late response but i guess it's never too late. Windows.Data.Pdf only supports rendering operations. Format specific operations like Search, Annotation enumeration etc are not exposed in the Windows.Data.Pdf library. Also Windows components do not rely on Windows.Data.Pdf

like image 36
Sridhar Avatar answered Oct 23 '22 21:10

Sridhar