Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal PDF Viewer Not supported in 43 #1144

Closed
amaitland opened this issue Jul 23, 2015 · 12 comments
Closed

Internal PDF Viewer Not supported in 43 #1144

amaitland opened this issue Jul 23, 2015 · 12 comments
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Milestone

Comments

@amaitland
Copy link
Member

Just a note for anyone interested, with the 2357 branch the internal PDF viewer no longer works.
https://bitbucket.org/chromiumembedded/cef/issues/1565/re-implement-pdf-viewer-using-out-of

You can of course enable NPAPI (which is disabled by default these days) and use Adobe Acrobat Reader

Example of how to enable NPAPI
https:/cefsharp/CefSharp/blob/master/CefSharp.Example/CefExample.cs#L48

This has been fixed in upstream and will be resolved in the 2454 branch aka 45 (which actually removes support for NPAPI, so it's pretty much required).

@amaitland amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Jul 23, 2015
@amaitland amaitland added this to the 43.0.0 milestone Jul 23, 2015
@amaitland amaitland modified the milestones: 45.0.0, 43.0.0 Aug 31, 2015
@amaitland
Copy link
Member Author

Moving this to the 45 milestone as that's when it's actually fixed.

Experimental build of 2454 is up at https:/amaitland/CefSharp

@ghost
Copy link

ghost commented Sep 2, 2015

Does this mean that the internal PDF viewer will be back in 45? If not, how would I get a PDF to show?

@amaitland
Copy link
Member Author

Does this mean that the internal PDF viewer will be back in 45?

Yes

@amaitland
Copy link
Member Author

If not, how would I get a PDF to show?

You can use 43 with the NPAPI Acrobat reader plugin, just have to enable plugin discovery as outlined above.

@ghost
Copy link

ghost commented Sep 3, 2015

Thanks for the help guys, I got it to show for 43 with the NPAPI enabled. I also tried downloading the most current 45, but it crashed when viewing PDF, not sure if it's been fixed in 45 yet.

@amaitland
Copy link
Member Author

I also tried downloading the most current 45, but it crashed when viewing PDF, not sure if it's been fixed in 45 yet.

The PDF viewer requires a new pak file for which I had to add and regenerate the cef.redist nuget packages, so you'll have to cleanup your nuget cache and local working pages to download the correct version. There is also a new command line argument required for PDF viewing in WPF see #1204

I've tested in WinForms after adding the missing pak file and basic testing shows it appears to be working.

@amaitland
Copy link
Member Author

Tested in WPF with required command line flag, basic tests working.

7df00f8#diff-8504643e16a7bcd2d9428f463a767ff9R81

Closing this as the basic issue is resolved. If more specific issues arise then please create a separate issue.

@renestalder
Copy link

Couldn't get it working with NPAPI.

So I tried with version 41, which works, but where the OnLoaded event ist missing which I need to load my JavaScript files. If there is a workaround for this in version 41, let me know.

Then I tried to get current upstream from your branch but couldn't build the project because nuget can't restore the cef.redis versions provided for x64.

Would be great to get help either using my JavaScript in verison 41 (must run after dom loading to grab links) or the new pre 45 version from your branch without nuget (as long it's not up on nuget).

@amaitland
Copy link
Member Author

Couldn't get it working with NPAPI.

Do you have Acrobat Reader installed? It definately works, I've got Acrobat Reader 11.0.13 and it works fine as per screen shot below.

cefsharp-pdf

So I tried with version 41, which works, but where the OnLoaded event ist missing which I need to load my JavaScript files. If there is a workaround for this in version 41, let me know.

NavStateChanged was renamed to LoadingStateChanged, it's the event I recommend.

https:/cefsharp/CefSharp/blob/cefsharp/41/CefSharp/IWebBrowser.cs#L48

Then I tried to get current upstream from your branch but couldn't build the project because nuget can't restore the cef.redis versions provided for x64.

What file does it say exactly is missing?

CI builds and -pre release versions are hosted on MyGet, see https://www.myget.org/gallery/cefsharp

Latest CI build for master was successful, see the results here https://ci.appveyor.com/project/cefsharp/cefsharp/build/45.0.0-CI1564

@renestalder
Copy link

Thanks for the detailed inputs.

I'm not saying NPAPI isn't working. I'm sure it does when @irnbw has got it running. For me, I couldn't get it working which might be more of a knowledge issue. Acrobat Reader DC is installed. That's what I get when downloading from the Adobe website.

NavStateChanged was renamed to LoadingStateChanged, it's the event I recommend.

Thanks for that. Seems like all I need for my project. IMHO quite an important change I would expect as breaking change in the changelog itself without the need to search through commits and diffs.

What file does it say exactly is missing?

screenshot 2015-10-29 13 32 34

I remember those errors from other projects and I think I would have to press some button somewhere in VS to fix it. But I can't remember all those things. Didn't work in .Net projects for years and have to fix a small application which depended on the native WebBrowser before I replaced it with CefSharp.

CI builds and -pre release versions are hosted on MyGet

Cool. Thanks.

@amaitland
Copy link
Member Author

Thanks for that. Seems like all I need for my project. IMHO quite an important change I would expect as breaking change in the changelog itself without the need to search through commits and diffs.

Anyone with a GitHub account can make changes, feel free to contribute.

I remember those errors from other projects and I think I would have to press some button somewhere in VS to fix it. But I can't remember all those things. Didn't work in .Net projects for years and have to fix a small application which depended on the native WebBrowser before I replaced it with CefSharp.

Your local copy of master is quite out of date. The version of CEF has been updated at least three times since your clone was made. Updating to the latest commit and everything should build correctly.

@amaitland
Copy link
Member Author

Version 45 now has it's own branch https:/cefsharp/CefSharp/tree/cefsharp/45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Projects
None yet
Development

No branches or pull requests

2 participants