Graham Murt 22 Posted September 22, 2021 Hey guys, I need to allow users to view PDF's in my Win32, Delphi 11 VCL app which could be installed on anything from Windows 7 onwards. Exe size is important as I'm pushing updates out several times per week. This rules Chromium embedded out for me. I'd also like it to not require any dependencies and be fully embedded in the *.exe. I've looked at TEdgeBrowser, this would work fine for Win10, where edge has PDF support but will cause support issues with earlier versions of Windows. So, I'm kinda left with options of either Gnostice or DevExpress. I've installed the DevExpress trial and the PDF viewer works great but the trial will only work with runtime packages enabled. Therefore I have no idea of the overhead it will add to my *.exe. So, (finally) to my question... does anyone have a DevExpress subscription? If you do, please could you add a PDF viewer to a blank app, compile it and let me know the increase in *.exe size? In the meantime, I'll see if I can try the Gnostice offering. Thanks, Graham Share this post Link to post
Marek Lieder 0 Posted September 22, 2021 Delphi 10.4 Update 2 Developer Express VCL 21.1.5 Empty Windows VCL app (release): 2 578 432 bytes Empty Windows VCL app + TdxPDFViewer component (release): 45 105 664 Empty Windows VCL app + TdxPDFViewer component + generate toolbar UI for it (release): 45 222 400 Share this post Link to post
Alexander Elagin 143 Posted September 22, 2021 (edited) Delphi 10.1 DevExpress VCL 20.1.5 win32 / Debug configuration Blank application: 2 200 576 bytes Blank application with a single TdxPDFViewer: 15 368 704 bytes With an autogenerated toolbar: 21 126 656 bytes. Edited September 22, 2021 by Alexander Elagin Share this post Link to post
Alexander Sviridenkov 360 Posted September 22, 2021 JFYI HTML Office Library (including HTML Component Library) adds 4.5Mb for all supported formats - PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, SC, MD, HTML, MSG. Final exe size (when compiled in 11 release) is 6.7 Mb. 1 Share this post Link to post
Lars Fosdal 1792 Posted September 22, 2021 There is also https://uberpdf.org/ by @Joe C. Hecht Share this post Link to post
Guest Posted September 22, 2021 (edited) Delphi 10.4.2 (Release) Delphi VCL 20.2 Ribbon Based Application (Empty Toolbar): 18 394 624 bytes Delphi VCL 20.2 Ribbon Based Application + TdxPDFViewer: 24 261 120 bytes Delphi VCL 20.2 Ribbon Based Application + TdxPDFViewer + Ribbon Toolbar: 24 375 808 Delphi Windows VCL Application: 2 578 432 bytes Delphi Windows VCL Application + TdxPDFViewer: 17 472 000 bytes Delphi Windows VCL Application + TdxPDFViewer + Toolbar* (2 TcxImageLists, an ActionList and a TdxBarManager ) 17 586 176 bytes DevExpress will allow you to convert docx, rtf through their TdxRichEditControl / TdxRichEditDocumentServer. That will, however add more to your exe size. I cannot access DevExpress site atm to see if PDFViewer is sold "standalone", but licence costs aside, @Alexander Sviridenkovs suggestion will probably lend you much more flexibility and smaller sizes. HTH Edited September 22, 2021 by Guest Unintended emoji *grr* Share this post Link to post
Anders Melander 1795 Posted September 22, 2021 2 hours ago, Lars Fosdal said: There is also https://uberpdf.org/ by @Joe C. Hecht I hope Joe is better at coding than designing web sites 🙂 4 Share this post Link to post
Guest Posted September 22, 2021 3 hours ago, Anders Melander said: I hope Joe is better at coding than designing web sites 🙂 I do not think this is an ok comment. We have a load of well-written libs with very old sites. Not just Joe's. Another discourse is the thing when new kids look and Delphi stuff looks "old". That is another discourse altogether. Share this post Link to post
dwrbudr 8 Posted September 22, 2021 ImageEn had PDF support. One DLL about 4MB is required for that. I've tested it and it works well. https://www.imageen.com/info/history.html Share this post Link to post
Stéphane Wierzbicki 45 Posted September 22, 2021 Did you see TMS announcement ? https://www.tmssoftware.com/site/blog.asp?post=836 Share this post Link to post
Anders Melander 1795 Posted September 22, 2021 4 hours ago, Dany Marmur said: I do not think this is an ok comment. I'm sorry about that, although I don't quite understand why you find it offensive. I'm sure Joe knows his stuff but appearance does matter. I actually looked at the site trying to find more information about the library but eventually gave up. Now that I look at it again I can see that what I thought was just more bullet points is actually links to sub pages. After that I had to read through all the FAQ to deduce that it's not a native Delphi library. If I had actually been looking to buy a PDF library (I'm not since I have a DevExpress subscription) I would have taken one look at that page and quickly moved on. Joe or not. 3 1 Share this post Link to post
Fr0sT.Brutal 900 Posted September 23, 2021 (edited) 13 hours ago, Dany Marmur said: I do not think this is an ok comment. We have a load of well-written libs with very old sites. Not just Joe's. I'm with Anders here. The guy is trying to sold his components (at least seems like so...) but there's no prices and any link leads to email form. As a possible option: you could embed DLLs into EXE as resources and extract them on launch. Thus you can utilize PDFium project, for instance. Edited September 23, 2021 by Fr0sT.Brutal 1 Share this post Link to post
Edwin Yip 154 Posted September 23, 2021 There is also Lasse's TPDFiumControl which is based on Andy's PdfiumLib which is in turn based on Google Pdfium (used in Chrome). Basically, PdfiumLib is a Delphi wrapper for Pdfium, but the rendering of pdf is one page at a time, and TPDFiumControl adds a vertical scrollbar. There is also Paul's PdfiumReader (similar to TPdfiumControl that adds vertical scrolling, but uses a custom build of Pdfium dlls), but unfortunately, it's GPL licensed and no other commercial options are available. I found that Pauls' PdfiumReader is much faster when scrolling than TPdfiumControl. That being said, if TPdfiumControl is as fast as PdfiumReader (when scrolling), it'll be perfect. Share this post Link to post
Guest Posted September 23, 2021 @Anders Melander, @Fr0sT.Brutal, my comment was about the visual appearance only, i should have made that more clear. Regarding disposition, in both site, doc and code that is quite another matter and in this area i agree with you both completely. I should apologise to Anders as i interpreted "designing web sites" as visual. That was my bad. Sry. Share this post Link to post
timfrost 78 Posted September 23, 2021 There is also the excellent PDFIUM DLL wrapper from Winsoft: https://www.winsoft.sk/pdfium.htm. You would not need to ship the PDFIUM DLL with every update of your software, though it does get updated from time to time. The viewer demo builds to 2.9MB, but the demo is a full viewer with scaling, rotation, printing, rendering etc. Share this post Link to post
Graham Murt 22 Posted September 23, 2021 Hi guys, Thanks for all of your input. After a little more research it appears that the Pdfium wrapper from Andreas (https://github.com/ahausladen/PdfiumLib) fits my needs perfectly. I wasn't aware of this component before. The DevExpress pdf viewer worked perfectly also but as I only require the PDF viewer right now I didn't make sense to purchase the whole DevExpress component set (although these do look awesome and I hope to look at them more next year having watched some videos) I made some small tweaks to the source code to add a page border and drop-shadow and now it looks a little more polished. I'll see if I can post these changes back to the repo. Thanks again for all your suggestions, Kind regards, Graham 5 Share this post Link to post
Edwin Yip 154 Posted September 23, 2021 @Graham Murt, looks good! I wonder if you can share the code that draws the shadows somewhere. Share this post Link to post
Guest Posted September 23, 2021 @Graham Murt, thank you for the feedback. It is sadly common that people that have begotten help just leaves it at that. Feedback is important. Good luck! Share this post Link to post
Darian Miller 365 Posted September 24, 2021 15 hours ago, Graham Murt said: Hi guys, Thanks for all of your input. After a little more research it appears that the Pdfium wrapper from Andreas (https://github.com/ahausladen/PdfiumLib) fits my needs perfectly. I wasn't aware of this component before. You may want to review this one as it has some recent changes to PdfiumLib https://github.com/TextEditorPro/TPDFiumControl Share this post Link to post
Joseph MItzen 251 Posted September 24, 2021 Crazy question, but why not just launch the system default PDF viewer? That's what every piece of software I have does. Share this post Link to post
Graham Murt 22 Posted September 24, 2021 16 hours ago, Edwin Yip said: @Graham Murt, looks good! I wonder if you can share the code that draws the shadows somewhere. Sure, I’ll fork the repo and add my changes later today. I’ll post a link here once I’ve got it ready. 1 Share this post Link to post
Graham Murt 22 Posted September 24, 2021 2 hours ago, Joseph MItzen said: Crazy question, but why not just launch the system default PDF viewer? That's what every piece of software I have does. Unfortunately, unless you’re running Windows 10, there simply isn’t a default pdf viewer unless the user has installed one themselves, or installed a piece of software which supports one. (E.g. chrome). Share this post Link to post
Graham Murt 22 Posted September 24, 2021 3 hours ago, Graham Murt said: Sure, I’ll fork the repo and add my changes later today. I’ll post a link here once I’ve got it ready. I've committed my small changes to a fork here... https://github.com/gmurt/PdfiumLib 1 Share this post Link to post
Edwin Yip 154 Posted September 24, 2021 3 hours ago, Graham Murt said: I've committed my small changes to a fork here... https://github.com/gmurt/PdfiumLib Thanks. BTW, If you want to use the latest pdfium libs, you must remove all those SetMatrix/GetMatrix functions. Share this post Link to post
sakura 45 Posted September 24, 2021 Also, check out https://www.wpcubed.com/pdf/ Share this post Link to post