Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Wpf PdfViewer in XAML Options
CDlaw
Posted: Thursday, August 9, 2018 6:57:23 PM
Rank: Newbie
Groups: Member

Joined: 8/9/2018
Posts: 3
I used nuget to get the plugin found here: https://www.nuget.org/packages/EO.Pdf.Wpf/

There doesn't seem to be any documentation to show what XAML code to use to place the PdfViewer in the WPF View.

Would you be able to provide an example usage?

Thanks
eo_support
Posted: Friday, August 10, 2018 10:53:01 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,821
Hi,

The nuget package is meant for runtime use. So it does not contain any samples or documentation. If you wish to have samples or documentations, you can download the full package from our download page. You will then find sample code for PdfViewer in our TabbedBrowser sample application inside PdfViewer.xaml.

There isn't much particular about the PdfViewer class. You basically put it in your xaml very much the same way as you put anything else in your xaml. You would then call the PdfViewer's Load method to load a PDF file. You can find details about all the methods/properties on this class from the online reference:

https://www.essentialobjects.com/doc/eo.wpf.pdfviewer.aspx

Hope this helps. Please feel free to let us know if there is anything else.

Thanks
CDlaw
Posted: Friday, August 10, 2018 11:49:53 AM
Rank: Newbie
Groups: Member

Joined: 8/9/2018
Posts: 3
Thanks for the info. I did have the samples, but was looking in the 'Pdf' and 'Wpf' projects - I didn't think to look under 'WebBrowser'.

When I follow the example in my own application, I get this compile error:

'Cannot resolve dependency to assembly 'EO.WebBrowser.Wpf, Version=18.2.53.0, Culture=neutral, PublicKeyToken=e92353a6bf73fffc' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

I also can't get the sample app with the PdfViewer - 'TabbedBrowser_CS' - to run - though maybe that is a separate issue. It builds in visual studio, but when hitting start it just opens and immediately closes: 'The program '[23316] TabbedBrowser.exe' has exited with code 0 (0x0).'

Thanks
eo_support
Posted: Friday, August 10, 2018 12:33:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,821
can you run the precompiled TabbedBrowser.exe directly from your installation folder?
CDlaw
Posted: Friday, August 10, 2018 4:22:06 PM
Rank: Newbie
Groups: Member

Joined: 8/9/2018
Posts: 3
I can't run the exe, but I figured out why: the antivirus software is blocking the executable based on 'behavior: ZwWriteVirtualMemory'. I'm trying to get that resolved and that should fix closing issue, but I think the dependency issue is separate since that .dll doesn't seem to be included in the nuget package.

Thanks again.
eo_support
Posted: Friday, August 10, 2018 4:46:27 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 20,821
Great. Glad to hear that you found out the root cause. The nuget package does not include the DLLs because it has a dependency on EO.Pdf nuget package, which would reference those DLLs.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.