Sherzod Posted June 9, 2014 Share Posted June 9, 2014 Hi All!! A PDF Viewer Panel - No Browser Plugin required, pure JavaScript Source: http://www.sencha.com/forum/showthread.php?237361-A-PDF-Viewer-Panel-No-Browser-Plugin-required-pure-JavaScript Demo: http://SunboX.github.com/ext_ux_pdf_panel/demo/ Github Project: https://github.com/SunboX/ext_ux_pdf_panel How to use: TRY... 1. Download files: http://sunbox.github.io/ext_ux_pdf_panel/lib/pdf.js/compatibility.js --> copy to directory (/files/pdf/) sunbox.github.io/ext_ux_pdf_panel/lib/pdf.js/pdf.js --> copy to directory (/files/pdf/) http://sunbox.github.io/ext_ux_pdf_panel/ux/util/PDF/TextLayerBuilder.css --> copy to directory (/files/pdf/pdf/) http://sunbox.github.io/ext_ux_pdf_panel/ux/panel/PDF.js --> copy to directory (/files/pdf/pdf/) http://sunbox.github.io/ext_ux_pdf_panel/ux/util/PDF/TextLayerBuilder.js --> copy to directory (/files/pdf/pdf/) 2. Add CustomFiles in UniServerModule: files/pdf/compatibility.js files/pdf/pdf.js files/pdf/pdf/PDF.js files/pdf/pdf/TextLayerBuilder.js files/pdf/pdf/TextLayerBuilder.css 3. Paste into a form UniHTMLFrame1 and add UniHTMLFrame1.HTML...: <div id="pdfviewer" align="center"></div> 4. procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS('if (Ext.get("pdfviewerpanel")) {Ext.get("pdfviewerpanel").remove()};'); UniSession.AddJS('Ext.create(''Ext.ux.panel.PDF'', {' + 'id : "pdfviewerpanel", ' + 'title : ''PDF Panel'',' + //'width : ' + IntToStr(UniHTMLFrame1.Width) + ' ,' + //'height : ' + IntToStr(UniHTMLFrame1.Height) + ',' + 'width : 489,' + 'height : 633,' + 'pageScale: 0.75,' + 'src : ''http://cdn.mozilla.net/pdfjs/tracemonkey.pdf'', ' + 'renderTo : "pdfviewer"' + //'renderTo : Ext.getBody()' + '});'); end; Best regards. Quote Link to comment Share on other sites More sharing options...
stas Posted June 9, 2014 Share Posted June 9, 2014 Hi Thanks Other method with pdf.js DisplayPdf:=UniServerInstance.NewLocalCacheFile('pdf'); CopyFile(MyPdf,DisplayPdf,False); S:=UniServerInstance.LocalCacheURL; S:=S+ExtractFileName(DisplayPdf); if copy(S,1,1)<>'/' then S:='/'+S; S:=UniServerInstance.FilesFolderURL+'pdf.js/web/viewer.html?file='+S; UniUrlFrame1.url:=S; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 9, 2014 Author Share Posted June 9, 2014 Thanks Stas. I'm not very delved... Quote Link to comment Share on other sites More sharing options...
stas Posted June 9, 2014 Share Posted June 9, 2014 Hello Pdf.js very cool product, but FastReport pdf without embedded fonts and russian letters display incorrect. Quote Link to comment Share on other sites More sharing options...
brunotoira Posted June 9, 2014 Share Posted June 9, 2014 WOW!!!!!!!!!!!! THIS ROCKS !!! Thanks!!! Quote Link to comment Share on other sites More sharing options...
ganzqgy Posted June 11, 2014 Share Posted June 11, 2014 Double byte character support is not good.IE does not support Quote Link to comment Share on other sites More sharing options...
docjones Posted June 11, 2014 Share Posted June 11, 2014 thanks for sharing, That's perfect for integration into unigui, but I miss some basic things such as being able to print, or that the document is not paginated i Attach a demo sample in xe2, all included. Complile and run in debug mode. (or copy files debug/files to /release/files to run in release mode) PdfViewer.rar Quote Link to comment Share on other sites More sharing options...
lema Posted June 11, 2014 Share Posted June 11, 2014 Thanks for sharing ! Quote Link to comment Share on other sites More sharing options...
aans Posted January 30, 2015 Share Posted January 30, 2015 its work in android tablet ? Quote Link to comment Share on other sites More sharing options...
mroustaei Posted April 28, 2018 Share Posted April 28, 2018 hello docjones i run program and click load then pdf opening download manager do not show pdf into panle Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.