Creating and showing pdf in Ionic

后端 未结 1 488
走了就别回头了
走了就别回头了 2021-01-05 22:18
  1. I am using PDFMAKE to create a base64 encoded pdf and I tried to show it with the Iframe by giving the encoded base64 to iframe src. It works on PC but it didn\'t w

1条回答
  •  长情又很酷
    2021-01-05 23:11

    So for our company app we used angular-pdf Viewer:

    Here is the template for the pdf viewer template, putting inside a ion-scroll allows for pinch zoom and it works great.

    Loading PDF...

    then on the page that shows the pdf:

    
        

    You feed the template to the pdf viewer and it will show up on the page.

    To use it first include the right js files:

    
    
    
    

    then inject pdf:

    var app = angular.module('App', ['pdf']);
    

    you can read more about it here, but using it in combination with ion-scroll it works just like you think it should on a native device:

    https://github.com/winkerVSbecks/angular-pdf-viewer

    0 讨论(0)
提交回复
热议问题