Unable to use wj-pdf-viewer

Posted by: soven on 27 February 2021, 5:05 am EST

  • Posted 27 February 2021, 5:05 am EST

    I am using Angular 10. I have a simple requirement to show a local pdf file streamed via nodejs server side code. I don’t see any errors in console. It just stays on - “Loading…” or if I provide a static file reference, it adds $pdf at the end and complains about 404 which is rightly so.

    <wj-pdf-viewer #pdfViewer
            serviceUrl="https://dev.bkvlocal.com/assets"  
            [filePath]="'pdf/sample.pdf'">
    </wj-pdf-viewer>
    

    It should not be this hard to view a pdf that is streamed through a URL. I have checked domain and license and all is good.

  • Posted 1 March 2021, 12:55 am EST

    Hi Soven,

    The PDFViewer cannot display static PDFs which are stored in your server or client application as a static asset. It is only compatible with C1WebApi PDF Services and can only display the PDF returned from this API. So, you will need to pass the PDF through this web API. The serviceUrl should be the URL of this web API.

    You can refer to the documentation below that demonstrates how to create a C1WebApi server:

    https://www.grapecity.com/componentone/docs/webapi/online-webapi/PDFDocumentServices.html

    Let me know in case you have any doubts or issues.

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels