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

**URL:** <https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049>\
**Category:** Technical Support\
**Created:** [September 20, 2022, 12:54pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049 "2022-09-20T12:54:41Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin.spencer](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@justin.spencer](https://pdfjs.community/u/justin.spencer)\
**Post date:** [September 20, 2022, 12:54pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/1 "2022-09-20T12:54:41Z")

</div>

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.

 ![image-2022-09-20-13-23-51-655](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/c/c45861e7ab06a996b8f17c53c2805cde2b16d11b.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [September 20, 2022, 12:54pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/3 "2022-09-20T12:54:48Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

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

Guides:
- [Adding your license key - PDF.js Express Plus License Keys](https://pdfjs.express/documentation/get-started/add-license-key#pdf.js-express-plus-license-keys-<span-class='plus'></span>)
- [PDF.js Express Documentation - Our Products - PDF.js Express Plus](https://pdfjs.express/documentation#pdf.js-express-plus)
- [PDF.js Express Plus Overview - What is PDF.js Express Plus?](https://pdfjs.express/documentation/get-started#what-is-pdf.js-express-plus?)

APIs:
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)
- [ExpressUtils(optionsopt) - # async set() → {Promise.}](https://pdfjs.express/api/utils/ExpressUtils.html#set__anchor)
- [Adding a download button](https://pdfjs.express/api/utils/tutorial-Adding%20a%20download%20button.html#__anchor)

Forums:
- [TextHighlightAnnotation does not highlight correct text height](https://pdfjs.community/t/texthighlightannotation-does-not-highlight-correct-text-height/1973/1)
- [Printed annotations not always displaying text](https://pdfjs.community/t/printed-annotations-not-always-displaying-text/1937/1)
- [Problem retrieving annotations from sqlite3](https://pdfjs.community/t/problem-retrieving-annotations-from-sqlite3/1617/1)

  
  

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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 20, 2022, 6:50pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/4 "2022-09-20T18:50:55Z")

</div>

Hi [justin.spencer](https://pdfjs.community/u/justin.spencer),

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

> **[PDF.js Viewer Demo | PDF.js Express](https://pdfjs.express/demo?product=plus)**
>
> Try the PDF.js Express Viewer demo: 26 out-of-the-box annotations, PDF form filling, e-signatures, UI customization, light/dark themes & more.

or on our sample site:  
[https://pdfjs.express/samples/viewing/viewing/](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](http://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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![justin.spencer](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@justin.spencer](https://pdfjs.community/u/justin.spencer)\
**Post date:** [September 21, 2022, 9:46am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/5 "2022-09-21T09:46:03Z")

</div>

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

 ![Untitled](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/f/f3c24e65856580c41d9b9f9b2093958b8f6a69de.png)

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

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 21, 2022, 2:28pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/6 "2022-09-21T14:28:23Z")

</div>

Hi [justin.spencer](https://pdfjs.community/u/justin.spencer),

Here is our guide on exportAnnotations:

> **[Importing and exporting annotations | Documentation](https://pdfjs.express/documentation/annotation/import-export.8)**

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](https://pdfjs.express/documentation/get-started-viewer/add-license-key#development)

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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![sodubanjo](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sodubanjo](https://pdfjs.community/u/sodubanjo)\
**Post date:** [September 22, 2022, 3:01pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/7 "2022-09-22T15:01:18Z")

</div>

Hi,

I am having a similar issue even on your demo platform.  
[PDF.js Viewer Demo | PDF.js Express](https://pdfjs.express/demo).

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

 ![Screen Shot 2022-09-22 at 4.00.17 PM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/8/8662f768544ac7e4832d9d08b18766ed76bb7719.png)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 22, 2022, 5:00pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/8 "2022-09-22T17:00:39Z")

</div>

Hi there,

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

> **[Open a document, add annotations, download | Documentation](https://pdfjs.express/documentation/use-case/upload-download)**

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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![sodubanjo](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sodubanjo](https://pdfjs.community/u/sodubanjo)\
**Post date:** [September 23, 2022, 8:00am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/9 "2022-09-23T08:00:13Z")

</div>

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](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/2/254391ae8b41f7b057f798f5c44e03d6db1dd2f8.png)

I have used the information in your guides below and i am still having the same issue [Open a document, add annotations, download | Documentation](https://pdfjs.express/documentation/use-case/upload-download) and [Importing and exporting annotations | Documentation](https://pdfjs.express/documentation/annotation/import-export).

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 23, 2022, 4:13pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/10 "2022-09-23T16:13:25Z")

</div>

Hi there,

Please try this build here:  
[https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309.zip](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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![justin.spencer](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@justin.spencer](https://pdfjs.community/u/justin.spencer)\
**Post date:** [September 26, 2022, 9:38am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/11 "2022-09-26T09:38:19Z")

</div>

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.

 ![arcerror](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/9/935f9461d042252b9eb20be02fc80666cc0bff48.jpeg)

---

<div class="post-metadata">

**Author:** ![sodubanjo](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sodubanjo](https://pdfjs.community/u/sodubanjo)\
**Post date:** [September 26, 2022, 10:16am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/12 "2022-09-26T10:16:36Z")

</div>

Hi,

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

Thanks

 ![Screen Shot 2022-09-26 at 11.14.24 AM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/6/6831f1bb3980596989e7db10e22d85d982db2ea5.jpeg)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 26, 2022, 4:28pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/13 "2022-09-26T16:28:44Z")

</div>

Hi there,

Please try this new build here:  
[https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309.zip](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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![justin.spencer](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@justin.spencer](https://pdfjs.community/u/justin.spencer)\
**Post date:** [September 27, 2022, 6:31am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/14 "2022-09-27T06:31:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sodubanjo](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sodubanjo](https://pdfjs.community/u/sodubanjo)\
**Post date:** [September 27, 2022, 8:04am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/15 "2022-09-27T08:04:24Z")

</div>

Hi

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

Thanks

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [September 27, 2022, 7:46pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/16 "2022-09-27T19:46:34Z")

</div>

Hi there,

Please try the following link:  
[https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/WebViewer/PDFJSExpress-8.7.0-36309-2.zip](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:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/9/97e377a1c03b22aa112b414350711b5fcf6e2705.jpeg)

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](https://utm.guru/ueQNw)

---

<div class="post-metadata">

**Author:** ![justin.spencer](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@justin.spencer](https://pdfjs.community/u/justin.spencer)\
**Post date:** [September 30, 2022, 10:54am UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/17 "2022-09-30T10:54:57Z")

</div>

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).

 ![arcerror2](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/7/78214bf6d75d1b849e4b932d7922ded986d76df3.png)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [October 3, 2022, 9:14pm UTC](https://pdfjs.community/t/annotation-line-tools-javascript-error-super-is-not-defined/2049/18 "2022-10-03T21:14:39Z")

</div>

Hi [justin.spencer](https://pdfjs.community/u/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](https://utm.guru/ueQNw)
