PDF Control: Performance Enhancements and Adobe Style Print Dialogs (Coming soon in v14.2)

22 November 2014

Performance

One of the big factors when working with any external file is performance, its one thing to be able to deal with a couple of marketing PDFs, but something totally different when you start processing files containing many hundreds of megabytes.  In the new v14.2 release the team revisited the speed of the PDF engine , optimizing the way documents are loaded. The following example is based on a 60,000 page PDF (800mb) document 

Metric

v14.1

v14.2

Chrome

Adobe

Load Time (seconds)

35

6

12

1

Memory

1.1GB

220MB

1.1GB

120MB

You can see from the table that there are significant performance gains in terms of speed and memory consumption, so how was this achieved? In previous versions of the PDF engine after setting the DocumentFilePath (or DocumentSource property), it was guaranteed that all input operations would be fully completed, this was the major factor causing low performance. The file would be read in it's entirety before returning to the control. The new v14.2 engine will lock the file for the time it is open, replicating the same behaviour used by Adobe Reader and allowing for the much improved metrics. If however you need to retain the older methods (no file locking), there is a new property available in the PDF Viewer – DetachStreamAfterLoadComplete, and an overload method for the PDF Document Processor – LoadDocument – detachStreamAfterLoadComplete as the second parameter.

 

Print Preview Dialog

Another frequently requested feature was advanced printing, v14.2 implements some amazing updates to the print preview system. A new print dialog has been introduced that boasts a full set of options for printing documents.

PDFPreview

The first thing to notice is the real time preview window, showing exactly what you are going to print.  The pager control will allow you to step through just the pages that will be included in the print and how it will look on paper. The print dialog allows granular control over ever aspect of the output.

Page range selection can include a set of pages such as 2-5 which would include page 2 through to page 5, you can also stipulate the order of pages, so 2-5,1,6 would print pages 2-5 then page 1 followed by page 6.

PDFPages

There is an option to fit to page, actual size or custom page scaling.

PDFSize

Page orientation can be forced to portrait or landscape, alternately you can tell the printing system to auto calculate the orientation. If the scaling option is set to ‘fit to page’ and orientation is set to ‘auto’ the print engine will attempt to set the orientation and scaling to maximize the most of the available paper size.

PDFOrientation

Another new addition to the printing system is the control over DPI output. With v14.2 you have full management over the quality and performance by controlling the print density via the DPI parameter.

PDFDpi

Of course, all of these features are available in the WinForms and WPF PDF Viewers or via the PDF Viewer API.

If you have any comments or questions, please feel free to contact me!

Paul Usher
Email: paulu@devexpress.com
Twitter: @dxAustralia

5 comment(s)
Hans Nieuwenhuis

I'm always impressed by your improvements in memory usage and processing time!

22 November, 2014
Edhy Rijo

Hi Paul,

Great features, thanks.  

Performance is a very important issue always.

Any idea if there are plans to allow PDF Form Filling capabilities to the tool?  

This will allow us to open a PDF form with fields and update those fields values with our own data.

Thanks!!!

24 November, 2014
Andrew Macdonald

These are great additions hopefully we will see multiple page, booklet and poster printing to fully match adobes print dialog in a future release. I know I would make use of these if they were available in the printing library.

24 November, 2014
Christopher Todd

Huge improvement on memory usage! Previously when creating a 1000+ page document, it would sometimes run out of memory. Now, it barely creeps over 280.

24 November, 2014
Paul Usher (DevExpress)

Thank you for your feedback about programmatic form completion. We are still working on this functionality and it won't be available for v14.2. We hope to have it ready for an interim release before v15.1.

24 November, 2014

Please login or register to post comments.