A4 and A3 pages and the document


https://www.nevron.com/Forum/Topic8883.aspx
Print Topic | Close Window

By Hans Henrik Friis Pedersen - 9 Years Ago
Hi,
I have been construting some large diagrams and visualized these in a document1. Document1 is set with dimensions of Width = 900 and height = 900. How do I set the document settings so that it corresponds to - for instance - a A3 pages in landscape ?
By Nevron Support - 9 Years Ago
In order to make a diagram of a specific size both on screen and when printing you should perform the following steps (I’m using the A5 paper size here, because my printer does not support A3):

1. Change the drawing document measurement unit and configure the document’s size
document.MeasurementUnit = NMetricUnit.Millimeter;
document.Width = 210;
document.Height = 148;

2. Configure the page settings of the drawing document, make sure to set the printing margins to 0
NPageSettings pageSettings = document.Settings.PageSettings;
pageSettings.Landscape = true;
pageSettings.PaperKind = PaperKind.A5;
pageSettings.MarginsLeft = 0;
pageSettings.MarginsTop = 0;
pageSettings.MarginsRight = 0;
pageSettings.MarginsBottom = 0;

3. When needed, create a print manager and configure it to print the document on a single page
NPrintManager printManager = new NPrintManager(document);
printManager.Layout = PagedLayout.FitToPages;
printManager.PageRows = 1;
printManager.PageColumns = 1;
printManager.ShowPrintPreview();

If you want to skip the print preview dialog, use the Print method instead of the ShowPrintPreview one.