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

Upgrade to use web viewer 8.1 #17

Merged
merged 4 commits into from
Oct 6, 2021
Merged

Conversation

achenPDFTron
Copy link
Collaborator

Upgraded to use WebViewer 8.1
Also caught and handled error from WebViewer createDocument API:

File extension html is only supported by using WebViewer with WebViewer Server. See http://r.pdftron.com/fileformats for a full list of file formats supported by WebViewer. Visit https://www.pdftron.com/documentation/web/guides/wv-server-deployment for more information about WebViewer Server

@achenPDFTron achenPDFTron self-assigned this Oct 6, 2021
top: typeof style.top === 'number' ? style.top + pad : style.top,
left: typeof style.left === 'number' ? style.left + pad : style.left,
top: typeof style.top === 'number' ? (style.top as number) + pad : style.top,
left: typeof style.left === 'number' ? (style.left as number) + pad : style.left,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed this as typescript complained

"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
"devDependencies": {
"@babel/core": "^7.7.4",
"@babel/preset-env": "7.9.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isntalled some of these to get the
npm start
npm run build

command to work

const fetchedBlob = await blob;
return await coreControls.createDocument(fetchedBlob, { extension, l: l || globalLicense.get() });
try {
const document = await coreControls.createDocument(fetchedBlob, { extension, l: l || globalLicense.get() });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the line throwing that uncaught exception:

File extension html is only supported by using WebViewer with WebViewer Server. See http://r.pdftron.com/fileformats for a full list of file formats supported by WebViewer. Visit https://www.pdftron.com/documentation/web/guides/wv-server-deployment for more information about WebViewer Server

changed the typing to be Core.Document | undefined to handle it

Copy link
Contributor

@lbittner-pdftron lbittner-pdftron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@lbittner-pdftron lbittner-pdftron merged commit 63b1926 into master Oct 6, 2021
@lbittner-pdftron lbittner-pdftron deleted the upgrade-to-WebViewer-8 branch October 6, 2021 19:27
@lbittner-pdftron lbittner-pdftron restored the upgrade-to-WebViewer-8 branch October 6, 2021 19:27
@lbittner-pdftron lbittner-pdftron deleted the upgrade-to-WebViewer-8 branch October 6, 2021 19:28
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

Successfully merging this pull request may close these issues.

2 participants