Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need a way to add the total number of pages in a document to the PrintDialog:

 

PrintDocument printDoc = new PrintDocument();
void GenericFn()
{
 PrintDialog pd = new PrintDialog();
 pd.Document = printDoc;
 pd.PrinterSettings.FromPage = 1;
 pd.PrinterSettings.ToPage = 1; // how do I set this value from printDoc?
 pd.ShowDialog();
}

 

I'm using this DataGridViewer Printer class that nicely handles sending all of the code from the DataGridViewer to the printer using PrintDocument.PrintPage and PrintDocument.BeginPrint routines, but the code doesn't have a way to determine how many pages are in the entire document.

 

Is anyone here skilled in this?

 

I'd like my operators to be able to select only 1-5 pages to print, or cancel when they see it contains 115 pages, etc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...