Annotation line tools javascript error - "_super is not defined"

Using pdf.js express plus 8.7. When I try to use these line tools, I get the following exception “_super is not defined.” This error looks like a bug to me as there’s no declaration of _super in the code. Please advise.

See uploaded doc for details.
It fails in webviewer-core.min.js

On (“Custom appearances are unavailable in PDFJS Express.”),_super.prototype.Dh.call(this,Ua);var cb=document.createElement(“canvas”)

There’s no declaration of the variable “_super” anywhere in the code so I’m not surprised it fails.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi justin.spencer,

I am unable to reproduce your issue on the demo site (8.7)

or on our sample site:
https://pdfjs.express/samples/viewing/viewing/

Do you have any custom code that you can share here that may affect how your tool is being used?

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.
www.pdftron.com


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kevin, the issue for me appears to be in the exportAnnotations method. Do you have an example available for exports?

(sorry about the image, but it wouldn’t let me post code into the forum)

Hi justin.spencer,

Here is our guide on exportAnnotations:

I wanted to double check if you have the license key configured correctly (no need to provide the code as this is a public forum), as the error message mentions “Custom appearances are unavailable in PDFJS Express.”
Here’s a guide on that: PDF.js Express Viewer Download & Integration | Documentation

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi,

I am having a similar issue even on your demo platform.
PDF.js Viewer Demo | PDF.js Express.

To recreate this issue, open the link above, go to shapes and draw a line, polyline, ellipse or arc.
Then click on the download button

1 Like

Hi there,

Please use this guide to download PDF while we investigate this issue.

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi,

I am still having the same issue. Can you get someone to look into this. The problem is if you go to shapes and draw a line, polyline, ellipse or arc. Then you call instance.annotManager.exportAnnotations({}) in your code you will get the error bellow.
Screen Shot 2022-09-23 at 8.50.57 AM

I have used the information in your guides below and i am still having the same issue Open a document, add annotations, download | Documentation and Importing and exporting annotations | Documentation.

Hi there,

Please try this build here:
https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309.zip

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kevin,
that build looks better for all of the controls except for the arc control. See attached… the arc still generates the same exception.

Hi,

Thanks for this build, It seem the Arc is still throwing this error. Can you look into this please.

Thanks

Hi there,

Please try this new build here:
https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309.zip

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kevin, PDFJSExpress-8.7.0-36309.zip looks like the same version you gave me last Friday (and the arc control still has an issue). Did you mean to post a newer link?

2 Likes

Hi

I don’t think there is any changes between this build and the previous one. Can you look into this.

Thanks

Hi there,

Please try the following link:
https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309-2.zip

I am no longer able to reproduce with the exportAnnotations function:

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi Kevin,
much better now thanks. However I’m still getting errors with the arc control when I draw off the side of the page (is this a known issue).

Hi justin.spencer,

Thank you for your report.

It looks like this is a separate issue, as it happens for other tools as well when you click outside of the page. For now, you can simply select the annotation and delete it and exportAnnotation will work as normal.

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here