We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Set Printing Preferences programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

110347 Jul 30,2013 10:18 PM UTC Aug 1,2013 10:52 AM UTC WPF 1
loading
Tags: Diagram
Todd Lichtas
Asked On July 30, 2013 10:18 PM UTC

Is it possible to set specific printing preferences such as orientation and paper size in the code behind rather than asking the user to select these items through the print dialog:
 
For example to accomplish setting the orientation and paper size, the user must follow these steps
1.  Click the "Advanced" button on the Syncfusion "Print Diagram" dialog
2.  Select a printer from the Windows "Print" dialog
3.  Click the "Preferences" button on the Windows "Print" dialog
4.  Choose the desired "Orientation" on the "Printing Preferences" dialog
5.  Choose the desired "Paper Size" on the "Printing Preferences" dialog
6.  Click "OK" on the "Printing Preferences" dialog
7.  Finally Click on "Print" on the Windows "Print" dialog
 
I'd like to be able to create my own print dialog, and set these preferences on a per user basis.
 
Please let me know if this is possible
 
Todd

Sudhakar C [Syncfusion]
Replied On August 1, 2013 10:52 AM UTC

Hi Todd,

 

We have analyzed your query to print the diagram directly rather than through the print dialog box, we have created a sample for your reference. In that sample, there is a button named “Print”. Using this button, we can directly print the diagram without open the PrintDialogbox. For more information please refer the attached sample.

 

Note : In that sample we can manually set the page size also. Please refer the code snippet.

 

Code Snippet :

 

//Rectangle to contain the VisualBrush.

Rectangle rect = new Rectangle();

rect.Fill = VisualBrush;

 

// Here we have set the size of the Page as PageAreaSize. We can set whatever we needed.

rect.Arrange(new Rect(new Point(0, 0), pageAreaSize));

// For example : rect.Arrange(new Rect(new Point(0, 0), new Point(500,500)));

 

 

 

Please let us know if you have any concerns on this.

 

Regards,

 

Sudhakar C



CustomizeThePrinting_cb77a7e2.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;