Loading or streaming large xps file dynamicly

Oct 31, 2011 at 3:54 AM

I have a xps file over 30M size.

I want to load 1th page data only after loaded xps viewer.

but not dowload 30M the 1th time.

and when switch to 3th page, lazyload the 3th data dynamicly.

could u provider some solution for it, thanks a lot.

Oct 31, 2011 at 10:59 AM

Hi guozili,

Document Toolkit supports incremental loading of XPS documents over the web. You'll need to use the WebPackageReader in combination with a document service that serves document parts on demand. The WebPackageReader is available in the FirstFloor.Document.IO namespace (assembly FirstFloor.Documents) and a full opensource implementation of a DocumentService is available in this project.

The SampleBrowser application demonstrates its use in the Document Loading Strategies sample.

- Koen

Feb 25, 2012 at 11:00 AM

Hi kozw,

I have a document about 47 MB with 5777 pages. I had implement solution in Document Loading Strategies as Document Service, but current it's loading very slow (about 5 mins) to display that document. Can you help me this problem?




Feb 27, 2012 at 10:46 AM
Edited Feb 27, 2012 at 10:46 AM

Hi Nghia,

A document of 5777 pages is pretty big and will cause perf issues when trying to render it in the DocumentViewer control, even when using the incremental web load strategy. The DocumentViewer is perfectly capable of rendering documents up to a 1000 pages smoothly. Beyond this number of pages, results may vary. I would highly recommend to render documents of this size a single page at a time. You should not use the DocumentViewer but a single FixedPageViewer instance as is demonstrated in the sample browser (http://firstfloorsoftware.com/liveapps/documenttoolkit2/#/SampleSinglePage)

Let me know if you need any further assistance.

- Koen