Not able to import 'wijmo/wijmo.viewer'

Posted by: Yizhen.Xu on 30 January 2018, 10:42 am EST

    • Post Options:
    • Link

    Posted 30 January 2018, 10:42 am EST

    Hi,

    I’m working with Angular 4 and wijmo 5.20173.403. I’m trying to use the wijmo pdf viewer, but I’m getting error:

    “Can’t resolve ‘/node_modules/wijmo/wijmo.viewer’ …” in my app.module.

    Can someone tell me why I’m getting this error?

    Thank you,

  • Posted 31 January 2018, 3:46 pm EST

    Hi Yizhen,

    Please refer to the following demo sample for implementation in Angular 2 application:

    http://demos.wijmo.com/5/Angular2/PdfViewerIntro/PdfViewerIntro/

    The code may be get from following link:

    http://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Sample/PdfViewerIntro/Angular2/Code

    The code may be also get offline in the offline samples shipped with build folder.

    ~Manish

  • Posted 5 February 2018, 11:45 am EST

    Hi Manish,

    Thank you for your reply, your example really helps, I’m able to import all the modules.

    But now I’m getting errors when I create an object url using URL.createObjectURL([pdf blob]) and pass it to the ‘filePath’ binding.

    So is it possible to bind the filePath to a blob url?

    Another question, is the ‘serviceUrl’ a required field for a pdf viewer?

    Thank you,

  • Posted 5 February 2018, 3:39 pm EST

    Hi,

    It seems that currently PDFViewer do not allow to View content using Blob. Hence, we forwarded this to the concerned team for confirmation with internal tracking id 307592.

    We will let you know as we get any update on this.

    As of now, serviceUrl & filePath is required parameter to show the PDF using Service.

    ~Manish

  • Posted 6 February 2018, 4:28 am EST

    Got it. Thank you Manish.

  • Posted 26 February 2018, 7:29 pm EST

    Hi,

    PDFViewer works solely with the server side C1 Web API PDFDocument Services:

    http://helpcentral.componentone.com/nethelp/C1WebAPI/webframe.html#PDFDocumentServices.html

    And filePath should be a path to a file known to the PDFDocument Services, it can’t be a data url.

    Hence, PDFViewer can’t view content using PDFBlob.

    ~Manish

  • Posted 26 February 2020, 11:26 pm EST

    Hi,

    Recently, we received a sample from our development team for showing the PDF content using PDFBlob in the PDFViewer.

    Please refer to the attached samples for reference where one is an API project to provide the base64 string to show in the PDFViewer.

    Another project is to configure the PDF Viewer to show the PDF content from base64.

    Please let us know if you have any further queries regarding this.

    Regards,

    Manish Gupta

    BlobPdfProvider.zip

Need extra support?

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

Learn More

Forum Channels