Printing a PDF - Paper size and colour options

Hi,

I'm evaluating Syncfusion for printing PDFs sliently from a .NET Windows Service and there are two things that I can't yet work out how to do.  I can load a PDF into the PdfViewerControl object and then use the PrinterSettings property to control the copies, duplex options and page orientation.  But I can't select a paper size (e.g A3 or A4) and I can't seem to be able to tell it to print in greyscale or colour.  Are there settings for this?

Thanks in advance for any help.

Regards,

Mark Oliver

3 Replies 1 reply marked as answer

DG Deepak Gunasekaran Syncfusion Team March 24, 2021 07:05 PM UTC

Hi Mark, 
 
At present we do not have support to set the following properties via the PrinterSettings 
·       Paper Size. 
·       Gray Scale color. 
However, we could see that there is printer settings available in the PrintDocument property, which may help you to achieve your requirements. Please refer to the code snippets below. 
To set paper size  
Use the PaperSize property of PrintDocument. 
if (printDocument.PrinterSettings.PaperSizes[i].Kind == PaperKind.A4) 
                { 
                    printDocument.DefaultPageSettings.PaperSize = printDocument.PrinterSettings.PaperSizes[i]; 
                } 
 
To set Gray scale 
Set the Color property of PrintDocument as false. 
if (printDocument.PrinterSettings.SupportsColor) 
                printDocument.DefaultPageSettings.Color = false; 
 
We have created a sample for the same and it can be downloaded from the following location: 
 
Please try the above and let us know if it helps you achieve the requirements. 
 
Regards, 
Deepak G 


Marked as answer

WI will April 3, 2023 07:57 AM UTC

Resolution

Click Start, point to Settings, and the click Printers.

Right-click the appropriate printer, and then click Properties.

Click the Paper tab, and then click the paper size you want to use in the Paper Size box.

Click OK, and then close the Printers folder.



SS Swetha Srikumar Syncfusion Team April 4, 2023 09:29 AM UTC

Thanks for the information.


Loader.
Up arrow icon