1

WPF print box with disabled print rages

The box above is what is called when a print() method is initiated on a flowDocumentPageViewer of flowDocumentScrollViewer.

In My application, I want my users to be able to select specific page range to print but the options seems to be disabled in the printbox. is there a way I can activate this in code.

Help will be appreciated as this tied to to a project I am doing.

Temitayo
  • 802
  • 2
  • 12
  • 28

2 Answers2

3

After alot of surfing the internet with no answer, I decided to check out my Library, my best pick was pro WPF 4.5 in c# 4th edition and I got the answer on page 941 chapter 29. Actually have read this before but I did not pick to detail and the author stressed that calling PrintDialog.UserPageRangeEnabled and others should be done before calling PrintDialog.ShowDialog()

I fixed this with that and viola, after months of stress, I got it right.

Although most of the printing features like PrintDialog.currentPageEnabled and PrintDialog.SelectedPagesEnabled are supported only in .NET 4.5 but I'm ok with with the PrintDialog.UserPageRangeEnabled because my app targets .NET 4 CF for I want it to be available to window xp users.

Below is the box now.

Printing with PrintDialog.UserPageRangeEnabled

Temitayo
  • 802
  • 2
  • 12
  • 28
2

Please take a look at the following post which explains printing from a FlowDocument:

Printing a WPF FlowDocument

You can find out more from 'Mitesh Sureja's Blog':

Printing Flow Document using WPF PrintDialog

Community
  • 1
  • 1
Sheridan
  • 68,826
  • 24
  • 143
  • 183
  • All this I know but the issue here is, I want to user to select page rage from the box, but it is disabled. I tried to set the UserPageRangeEnabled property to try but still, the page range options are still not active. All I want is the user to be able to specify a page range before printing. – Temitayo Aug 08 '13 at 13:55