locked
Why PDF rendering is so slow with PDF rendering classes in Windows 8.1 VS2013 RRS feed

  • General discussion

  • Hello,

    I tested the PDF rendering example application that can be found at:

    http://code.msdn.microsoft.com/windowsapps/PDF-viewer-sample-85a4bb30

    and measured the rendering time of PDF pages.

    The result was that rendering is so slow if compared with other C libraries I tested in the past. I am talking of 10x rendering time, for example, for some pages (60ms -> 600ms).

    I compared that also to the default Windows 8.1 PDF reader: it seems to yield good performances instead.

    I wonder if the same technology was implemented in PDF C# classes in VS2013 and why the page rendering is so slow?

    Thanks in advance for any help.


    Tuesday, November 5, 2013 2:18 PM

All replies

  • The PDF API is written in C++ (not even C++/CX). However it maybe slower than some engines because it is designed to stream content and not loading the whole file into memory.

    Could you share some PDF files you used in testing?




    Visual C++ MVP

    Tuesday, November 5, 2013 3:48 PM
  • Hello Sheng Jiang.
    Is there any chance they can distribute a different version of the library in the form of an assembly (or source) to be referenced in a Windows 8.1 RT application that isn't stream-oriented but instead memory-oriented? (So it is very fast, and it gives access to internal data of the PDF document too).
    Thank you in advance
    Tuesday, November 5, 2013 4:14 PM
  • That would probably have a large memory footprint. I have heard process crash when dealing large PDFs during the preview before they change to streaming,  are you sure you would not be dealing with large files?

    I can pass the request to access internal data but what kind of data do you want exactly?



    Visual C++ MVP


    Tuesday, November 5, 2013 5:47 PM
  • Thanks.
    I would like to access internal PDF document and PDF pages data to perform the following operations (but the list could be not exhaustive):
    - search string in text
    - get text to perform copy/paste, possibily in the form of list of text rectangles of a selection, like a string that begins at some point in the middle of a line until the end of the line and then continues at the start of the next line, passing x0,y0,x1,y1.
    - get links to other page or url/uri that are on a page as text
    - get the table of contents (xml tree)
    - (annotations?)
    but that would be useless for me without a very fast engine that yields the image of a page at a certain dpi or, preferably, at certain width or height dimension.
    However, even if the data are streamed from a file on disk, I do not think of a huge impact on rendering time, unless every PDF internal object is read as bytes from disk and the file is seeked many times to the pointed positions as it was in memory.

    However I am sure to deal with files not so huge (books).

    • Edited by P5music Tuesday, November 5, 2013 6:19 PM
    Tuesday, November 5, 2013 6:18 PM