Annotation Errors in Console log

Product: WebViewer

Product Version: 11.5.0

Please give a brief summary of your issue:
Can not find any annotation.
Conditional expression: !import_list.empty() || !strings.empty()

Please describe your issue and provide steps to reproduce it:
We’re generating annotations using the server SDK, but when viewing it on the web viewer, we saw bunch of errors in the console log tab of browser

Exception: 
	 Message: Exception: 
	 Message: Can not find any annotation.
	 Conditional expression: !import_list.empty() || !strings.empty()
	 Version      : 11.5.0-0bf366ff78
	 Platform     : Emscripten
	 Architecture : Emscripten
	 Filename     : AnnotationConversion.cpp
	 Function     : WriteAppearancesAsXod
	 Linenumber   : 164

	 Filename: 
	 Function: 
	 Linenumber: 

Please provide a link to a minimal sample where the issue is reproducible:
You can replicate the issue with these files in the showcase page.
semantic_1.pdf (215.2 KB)
semantic_1.xml (876 Bytes)

1 Like

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems like you’re encountering an issue with annotations not being found when viewing them in WebViewer, which could be related to how annotations are being generated or imported. This error message suggests a problem with the annotation list being empty or improperly formatted during the conversion process.

Some things you can try:

  • Ensure that the annotations are correctly formatted and associated with the PDF document. You may need to verify the annotation data structure.

  • Check if the server SDK is generating the annotations as expected and that they are being correctly loaded into WebViewer.

  • Verify that the document and annotations are being loaded with the correct paths and identifiers.

  • Consider using the loadDocument method to ensure documents and their respective annotations are properly loaded into the viewer.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello Jackson,

Thank you contacting us.

To investigate further please provide the following information:

  1. The server SDK version
  2. The code used to generate the annotations
  3. Any other relevant code snippets
1 Like

I use Go SDK 2.4.5 GitHub - ApryseSDK/pdftron-go: PDFTron GoLang
Here is my code: main.go (2.2 KB)

1 Like

Hi Jackson,

Can you describe the exact steps to get your error? Opening the semantic_1.pdf in https://showcase.apryse.com/ does not generate any console exceptions for me.

That specific exception you’re getting appears to be because you’re trying to convert the PDF to Xod, but the file does not contain any annotations. Can you provide more info on what you are trying to achieve?

1 Like

Hi Kmirsalehi,

Here are the steps:

  1. Go to XFDF Annotations | Apryse WebViewer
  2. Import PDF file
  3. Import XFDF file

Check the console log and see the error.

That specific exception you’re getting appears to be because you’re trying to convert the PDF to Xod, but the file does not contain any annotations

The PDF doesn’t contain any annotations, I attached 2 files in the original post:

  1. semantic_1.pdf
  2. semantic_1.xml this is the XFDF annotation file.

I already described what I want to do in the original post:

We’re generating annotations using the server SDK, but when viewing it on the web viewer, we saw bunch of errors in the console log tab of browser

Video recording
pdftron.mkv (1.8 MB)

1 Like

Hello Jackson,

I believe this issue is related to the annotations appearance. The apref tag references an appearance object on the PDF document which is why there are errors if you try importing the annotations to a different document. Even if the semantic_1.pdf was used on the backend to create these annotations, once you save the document without annotations the appearance object is removed.

If you remove the apref tag, then the error disappears when importing.

const xfdf = `<?xml version="1.0" encoding="UTF-8"?>
  <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
    <annots>
      <freetext TextColor="#FF0000" style="solid" width="0" creationdate="D:20250630050539Z" flags="print" date="D:20250630050539Z" name="page-location-3a0ce036-c771-4acb-b07f-d244712b1e1b" page="0" rect="562,752,602,772">
        <defaultstyle>color:#FF0000;font:Helvetica 12pt;</defaultstyle>
        <trn-custom-data bytes='{"cdx-type":"page-location"}'/>
        <defaultappearance> 1 0 0 RG 0 0 1 rg /Helv 12 Tf</defaultappearance>
        <contents>A5</contents>
      </freetext>
    </annots>
    <pages>
      <defmtx matrix="1.333333,0.000000,0.000000,-1.333333,0.000000,1056.000000"/>
    </pages>
    <pdf-info import-version="4" version="2" xmlns="http://www.pdftron.com/pdfinfo"/>
  </xfdf>`;

Best regards,
Darian

1 Like