This project is read-only.

Printing issues when specifying page range

Apr 23, 2012 at 2:50 PM

Hi there,

I'm having problems printing page ranges from the document viewer.

Once my xps document has loaded I can successfully print all pages or even apply a page range such as '1-12' without any issues. However if I specify a range such as '10-12' then the print fails. I've tested this for numerous xps documents with the same results.

Using the 'Custom Annotations' sample from your online samples ( I have experienced the same issue. If I print pages '10-12' it produces a 'Maximum retry count exceeded' error. I'm guessing this is caused due to the pages not having been loaded in the control? 

Any help would be appreciated.



Apr 23, 2012 at 9:15 PM

Hi Colin,

There is a known issue where Document Toolkit doesn't correctly print the pages when specifying a print range in the print dialog. The problem is unfortunately not easy to fix.

Also, this error occurs when the DocumentPrinter control is not added to the visual tree. See also

Kind regards,

- Koen

Apr 25, 2012 at 1:52 PM

Hi Kozw,

Is there any plans to rectify the page range issue, unfortunately I'm having to restrict users to printing one page at a time for the moment.

If there is a solution in the works I would appreciate notifcation of it so we can plan accordingly.



Apr 25, 2012 at 3:10 PM
Edited Apr 25, 2012 at 3:10 PM

Hi Colin,

There is an alternative that is suitable to your scenario; implement a page filter and assign it to DocumentPrinter.PageFilter. A page filter limits the pages that are outputted based on a custom algorithm. IPageFilter is the interface to implement. A custom page filter implementation is available in the source code ( The sample page filtering uses this filter (

- Koen