PDF load error in angular

Posted by: nsilva on 13 June 2023, 4:29 am EST

    • Post Options:
    • Link

    Posted 13 June 2023, 4:29 am EST - Updated 13 June 2023, 4:34 am EST

    When trying to load a pdf, the alert error is displayed: “PDF Viewer Factory is not ready.”

    I’m creating a page for pdf viewer, outside app.component, if it’s created in app.component everything works, but I need a dedicated component.

    Angular version: 12

    GcPDF version: 4.1.3

    Ionic: 6

  • Posted 14 June 2023, 3:22 pm EST

    Hello Silva,

    We tried to create the dedicated component for GcPdfViewer and used it in the app.component and it works fine.

    Please find the attached sample for reference.

    Regards,

    Manish Gupta

    Viewer_ChildComp_SaveChange.zip

  • Posted 15 June 2023, 5:41 am EST

    But I need to load the pdf file in another route or component, but when doing this outside of app.component, the loading of the pdf file fails.

    Thank you for your help.

  • Posted 15 June 2023, 6:02 pm EST

    Hi,

    Could you please share a working sample project( or you may modify the same that Manish shared) that replicates the issue so that we could investigate the issue and help you accordingly?

    regards,

    Avinash

  • Posted 21 June 2023, 6:15 am EST

    Hi everyone,

    I solved the problem by adding a setTimeout inside the ngAfterViewInit method.

    Do you have the javascript version of the documentation for implementing the Gcpdf viewer?

    Thanks for all.

    Regards.

  • Posted 21 June 2023, 5:24 pm EST

  • Posted 22 June 2023, 1:47 am EST

    Hi Avinash, thanks for your help.

    Now, all work well.

    I’ve got the license key for version 5, but I don’t find this specific version for download, my test runs version four at the moment, without a license.

    Do you have a link to the five versions of gcpdf?

    Regards.

  • Posted 23 June 2023, 3:59 am EST

    Dear friends, thanks for your help.

    Now, all work well.

    Regards.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels