Home » U++ Library support » RichText,QTF,RTF... » Printing in Windows - selecting 2 copies, prints 4 copies
Printing in Windows - selecting 2 copies, prints 4 copies [message #35958] |
Mon, 09 April 2012 02:41 |
tdtran
Messages: 4 Registered: July 2008
|
Junior Member |
|
|
Hi All,
Has anyone run across the issue with using Report Perform(), and setting "Number of copies" to 2 in the Print dialog.
If the chosen printer is a physical printer, it will print 4 copies instead of 2. On the other hand, printing to an image printer (say Miscrosoft XPS Document writer), shows 2 copies in the same output file.
I suspect this is happening because PrintJob.Execute0 duplicates the pages as needed according to the number of pages selected. However, it does not take into account whether the printer supports it natively. In other words, the code 'prints' 2 copies, and the printer takes this output and prints 2 copies, resulting in 4 copies.
for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? dlg.nCopies : 1); c++)
for(int i = dlg.nFromPage - 1; i <= dlg.nToPage - 1; i++)
for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? 1 : dlg.nCopies); c++)
page.Add(i);
Does anyone agree with this assessment?
cheers,
tdtran.
|
|
|
Re: Printing in Windows - selecting 2 copies, prints 4 copies [message #36100 is a reply to message #35958] |
Fri, 27 April 2012 10:17 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
tdtran wrote on Sun, 08 April 2012 20:41 | Hi All,
Has anyone run across the issue with using Report Perform(), and setting "Number of copies" to 2 in the Print dialog.
If the chosen printer is a physical printer, it will print 4 copies instead of 2. On the other hand, printing to an image printer (say Miscrosoft XPS Document writer), shows 2 copies in the same output file.
I suspect this is happening because PrintJob.Execute0 duplicates the pages as needed according to the number of pages selected. However, it does not take into account whether the printer supports it natively. In other words, the code 'prints' 2 copies, and the printer takes this output and prints 2 copies, resulting in 4 copies.
for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? dlg.nCopies : 1); c++)
for(int i = dlg.nFromPage - 1; i <= dlg.nToPage - 1; i++)
for(int c = 0; c < ((dlg.Flags & PD_COLLATE) ? 1 : dlg.nCopies); c++)
page.Add(i);
Does anyone agree with this assessment?
cheers,
tdtran.
|
Quite possible. Unfortunately this seems to be specific for only some printers...
http://msdn.microsoft.com/en-us/library/windows/desktop/ms64 6940%28v=vs.85%29.aspx
It seems like PD_USEDEVMODECOPIESANDCOLLATE could help. Can you try it please with your printer?
Mirek
|
|
|
Goto Forum:
Current Time: Mon May 06 04:04:51 CEST 2024
Total time taken to generate the page: 0.01849 seconds
|