PDF Viewer - Windows

I am in progress of an application which, where I could be nice to display different file contents - including Pdf files. And here to my knowledge it should be possible to use a native pdf viewer embedded in the windows os. - I only focus on windows 10 and above…

So far I know, there should be some functions: PdfCreateRenderer to do this, but I have not the deep knowledge of the windows libraries, so my question is , if someone here in the forum have experience with this ?? - on the other hand I might be wrong… with regard to a native pdf reader in windows…

From a quick glance at the PdfCreateRenderer docs, it seems that PdfCreateRenderer might not be a very good fit for your use case. The remarks section says:

This function is specifically designed for DirectX apps that use C++ and Extensible Application Markup Language (XAML).

The PdfCreateRenderer function should be called to display single pages of a PDF file, one at a time. While you could call this function in parallel to display multiple pages at the same time, this could lead to unexpected results.

As far as I know, JUCE doesn’t use DirectX on Windows (so no way to get a IDXGIDevice pointer) and it definitely doesn’t use XAML. In addition, the function only renders a single page, so you would need to write all the code to implement scrolling and tracking the current page.

1 Like

OK thanks :slight_smile: - The this might not be the right way then… I just read somewhere that it should be possible to do a native pdf read in windows, so maybe there’s other ways… ? - I need to search more…

I’d like to share this with you, maybe it could be useful or someone, certainly more experienced than me, could help in the aim!

1 Like

Nice - I’ll have a look… I’m a bit rusty myself… - but still learning…

1 Like

Really cool, I’m developing on mac, so up to now I done it for osx, maybe it can give some ideas :upside_down_face:

Yes - Mac /OSX is a lot easier - due to native pdf functionality. But as far as I have searched on Microsoft, windows have something similar. I’ll drop a link to the MS stuff for windows: PDF document sample - Code Samples | Microsoft Learn - so far I’ve managed to Compile it…

Not with Juce, but the package it self from MS, and I can run a development version. However - it’s built for use with a lot of MS libraries, which I am normally not using - so that’s complete new to me, and I am struggling a bit with diving into that an understand it - in order to see, if that could be used. But with the sample from MS it shows that there must be some native PDF functionality in Windows to build on…

Have fun reading into it… :slight_smile:

1 Like

really thank you, I’ll try to read it!