Jump to content
Graham Murt

DevExpress PDF Viewer

Recommended Posts

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

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

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 by Alexander Elagin

Share this post


Link to post

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.

  • Like 1

Share this post


Link to post

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 by Dany Marmur
Unintended emoji *grr*

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post
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.

  • Like 4
  • Thanks 1

Share this post


Link to post
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 by Fr0sT.Brutal
  • Thanks 1

Share this post


Link to post

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

@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

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

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

 

image.thumb.png.e74531b33e0989e591514f862af95ba5.png

  • Like 5

Share this post


Link to post
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

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
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.

  • Like 1

Share this post


Link to post
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×