importAnnotations Undefined in 29.1.38 PDFViewer

  • Using Essential Studio JavaScript 29.1.38, CRG-generated ej2.min.js.
  • pdfviewer.importAnnotations is undefined; importAnnotation and importAnnotationsAsJson are functions and work.
  • Documentation lists importAnnotations for JSON imports.
  • Need confirmation of the correct method and/or CRG settings for 29.1.38.

    Am I missing something?
    TIA


  • 6 Replies

    PA Priyadharshini Annamalai Syncfusion Team April 21, 2025 09:17 AM UTC

    Hi 


    Sorry for the inconvenience. We are unable to reproduce the reported issue. For your reference, we have provided a sample and a video demonstrating the behavior. 

    In the sample, we downloaded the CRG with the latest version, exported and imported the annotations, and everything worked as expected. Kindly confirm whether you selected all the required modules and enabled the "minified" option while downloading the CRG. 

    To assist us further in our investigation, we request you to modify the shared sample to replicate the issue, provide a video recording demonstrating the problem, and share the exact version you are using. Additionally, describing the specific scenario in which the issue occurs will help us analyze the request flow more effectively and provide accurate support.

     

    Sample: Export and Import Sample

    Video: Export and Import


    Regards,

    Priyadharshini



    CG Chris Gorske April 21, 2025 11:22 AM UTC

    Hi,
    Thanks for the reply.
    I think I wasn't clear in what my particular issues was.

    I can indeed do, as you did in the video you attached, create annotations, export them using the menu and then import them using the menu.

    However I am trying to do this using code only.

    Even using the sample html you attached, after loading the page and open the DevTools inspector I find that the code

    viewer.importAnnotations is undefined  

    Whereas: 

    viewer.importAnnotationsAsJson
    
    and
    
    viewer.importAnnotation
    
    are defined.
    
    This appears to conflict with the documentation which suggest viewer.importAnnotations should exist and I wondered what is the correct code to execute. 


    Tks




    CG Chris Gorske replied to Priyadharshini Annamalai April 22, 2025 11:58 AM UTC

    Hi,
    Thanks for the reply.
    I think maybe I wasn't clear in what my particular issues was.

    I can indeed do, as you did in the video you attached, create annotations, export them using the menu and then import them using the menu.

    However I am trying to do this using code only.

    Even using the sample html you attached, after loading the page and open the DevTools inspector I find that the code

    viewer.importAnnotations is undefined   Whereas: 

    viewer.importAnnotationsAsJson and viewer.importAnnotation are defined. This appears to conflict with the documentation which suggest viewer.importAnnotations should exist and I wondered what is the correct code to execute.




    VS Venkada Subramanian Durai Syncfusion Team April 22, 2025 03:49 PM UTC

    Hi Chris,

    Thank you for your update. We were unable to reproduce the reported issue on our end and have shared a sample for both server-backed and standalone modes. Could you please confirm whether you are using server-backed mode or standalone mode for importing annotations? To assist us in further investigation, kindly provide a sample project where the issue can be reproduced, along with a video recording of the problem you're encountering. Additionally, please specify the version of the Syncfusion PDF Viewer you're using on both the client and server sides, if applicable. Please note that the importAnnotation method is used in the PDF Viewer control, not importAnnotations.

    Sample: 

    Client: Client Sample

    Service: Service Sample

     

    Steps:

    1. Run the web service.
    2. Run the client application.

     

    Standalone Mode:

    Sample: Import Annotation Sample

    Documentation: Import export annotation in EJ2 JavaScript Pdfviewer control | Syncfusion


    Regards,

    Venkada Subramanian D



    CG Chris Gorske replied to Venkada Subramanian Durai April 25, 2025 11:08 AM UTC

    Thanks.
    The last line of your message gave me the answer to the question I have been asking from the start.

    Please note that the importAnnotation method is used in the PDF Viewer control, not importAnnotations.

    




    PA Priyadharshini Annamalai Syncfusion Team April 28, 2025 09:43 AM UTC

    Hi Chris Gorske,


    We're pleased to hear that your issue has been resolved. Don't hesitate to reach out if you need any further assistance. 


    Regards,

    Priyadharshini


    Loader.
    Up arrow icon