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

Adobe requires migration from legacy to "modern" viewer #2

Closed
SummittDweller opened this issue Feb 10, 2023 · 14 comments
Closed

Adobe requires migration from legacy to "modern" viewer #2

SummittDweller opened this issue Feb 10, 2023 · 14 comments

Comments

@SummittDweller
Copy link

I just started using this plug-in in a new Eleventy site and Adobe is prompting me to "Please update your PDF Embed API viewer". When I open their Migration Guide I found this:

To migrate over Adobe's new modern PDF viewer, developers are required to use [viewer.js](https://documentservices.adobe.com/view-sdk/viewer.js) script (line 11) in place of the previously used [main.js](https://documentservices.adobe.com/view-sdk/main.js) script. All APIs and callbacks will work as expected with significant improvement in user experience.

I've forked this repo to try and update per the migration instructions, and I'll report back here if/when I have something.

@cfjedimaster
Copy link
Owner

In theory it should only be changing the url, nothing more. :) If you haven't started it, I can fix it in main quickly enough.

@SummittDweller
Copy link
Author

Sounds right to me, and no, I haven't started anything yet. Thanks! My site is coming from a Hugo instance where I was using pdf.js so I've also been looking into using that for display.

@cfjedimaster
Copy link
Owner

I committed the change directly, no testing, cuz I live on the edge. Let me know. :)

@SummittDweller
Copy link
Author

I like the edge too. Be happy to give it a test, but I'm new to 11ty so can you tell me how I update my local site to the latest version of this package? I tried npm i eleventy-plugin-pdfembed --save in my project directory and then npm run build followed by npm run start but that didn't appear to do anything useful (no change to my package.json).

@cfjedimaster
Copy link
Owner

There is probably a better way, but I'd npm uinstall it, then npm install it. Oh wait, I didn't update npm yet. Give me a few minutes (stuck in a boring meeting).

@SummittDweller
Copy link
Author

Belay that order, mate! I did npm i https://github.com/cfjedimaster/eleventy-plugin-pdfembed, gave it a test, and it worked perfectly! Thank you so much for the quick action on this! Awesome response!

Ok, now feel free to update npm at your leisure. Thanks again.

@cfjedimaster
Copy link
Owner

Heh I didn't even know npm could install from a repo! Thank you!

@cfjedimaster
Copy link
Owner

FYI, I'm going to edit the version in package.json, so technically your copy will not be 100% up to sync, but no need to do anything else I think.

@SummittDweller
Copy link
Author

I'm learning too. Got that install-from-GitHub advice from https://www.pluralsight.com/guides/install-npm-packages-from-gitgithub. Apparently you can even npm install from a gist.

A little later I'll do the npm uninstall and then re-install it. The install from GitHub even updated my packages.json file accordingly so I need to override that at some point. I'm currently playing with view options on the plug-in.

@SummittDweller
Copy link
Author

I wonder if some of the options might have changed? When I tried 'SIZED_CONTAINER' I got the migration message from Adobe again. 'IN_LINE' seems to work just fine and it's what I need so I'm going to go with that. However, feel free to ping me if you need a quick test of any other changes.

Another note... Not sure it was intended, but I found that using relative paths to "passthrough" PDF files also works. The syntax I'm successfully using in my local build is: {% pdfembed '../static/pdfs/wieting-501c3.pdf' 'IN_LINE' %}. static is the name of my "passthrough" directory (that's old Hugo convention) and I copied my pdfs subdirectory into the project there. Works beautifully, at least with my local build.

@cfjedimaster
Copy link
Owner

In theory, published to npm. Thank you again and please reach out if you have any questions. I would say that if you have questions about PDF Embed itself, email me directly.

@SummittDweller
Copy link
Author

Ok, I'm thinking that migration message was something that got cached. All of the options are working as-expected now.

Great blog and background post by the way. We have similar stories and interests, although I only have 3 kids (plus 2 cats) and my early IT work was in FORTRAN... yup, that's because I was a Civil Engineer in a former life galaxy far, far away.

@cfjedimaster
Copy link
Owner

I didn't notice your previous comment when I mentioned I updated npm and closed - sorry about that - but it looks like you are ok - so lets pretend I knew the future. ;)

@cfjedimaster
Copy link
Owner

Thank you for the donation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants