Diagram / Import and Export / Export / Printing a Drawing
In This Topic
    Printing a Drawing
    In This Topic

    The NDrawingPrintExporter can help you print the content of the active page of a drawing.

     Configuring the Print Layout

    To configure how a drawing page should be printed or exported to PDF use the PrintLayout property of the page. The following code demonstrates how to configure export of the whole drawing page to a single page of size A4:

    Configuring Print Layout
    Copy Code
    NPagePrintLayout printLayout = drawingView.ActivePage.PrintLayout;
    printLayout.PageSize = new NPaperSize(ENPaperKind.A4);
    printLayout.PageColumns = 1;
    printLayout.PageRows = 1;
    

    Explore the other properties of the page's PrintLayout if you want to further customize the printing / export to PDF.

     Printing

    The following code shows a print dialog, which allows the user to print the active page:

    Printing the active page of a drawing with print preview
    Copy Code
    NDrawingPrintExporter imageExporter = new NDrawingPrintExporter(drawingView.Content);
    imageExporter.ShowDialog(drawingView.Content, true);
    

    To skip the print preview and show the native print dialog directly, use the Print method of the print exporter:

    Printing the active page of a drawing directly
    Copy Code
    NDrawingPrintExporter printExporter = new NDrawingPrintExporter(drawingView.Content)
    printExporter.Print();
    
    See Also