Pdf.js and viewer.js. Pass a stream or blob to the viewer

前端 未结 5 1603
一个人的身影
一个人的身影 2020-11-27 15:40

I\'m having troubles in finding a solution for this: I retrieve a PDF blob from a SQL filestream field using Javascript in this way (it\'s a lightswitch project)

<         


        
5条回答
  •  孤独总比滥情好
    2020-11-27 16:38

    var url = URL.createObjectURL(blob);
    
    var viewerUrl = 'web/viewer.html?file=' + encodeURIComponent(url);
    
    // TODO: Load the PDF.js viewer in a frame or new tab/window.
    
    //-- Abobe code opens a new window but with errors : 'Missing PDF 
    // blob://http://server-addr:port/converted-blob' 
    

提交回复
热议问题