In This Topic
The NDrawingPdfExporter can help you export the content of the active page of a drawing to PDF.
Saving with Dialog
The following code shows a save PDF file dialog, which allows the user to create a PDF from the active page content:
Exporting the Active Page of a Drawing Document to PDF |
Copy Code
|
NDrawingPdfExporter pdfExporter = new NDrawingPdfExporter(drawingView.Document);
pdfExporter.SaveAsPdf();
|
Saving to File or Stream
To export the active page of a drawing to PDF and save it directly to a file or a stream, without showing a save file dialog, you should use the SaveToFile or SaveToStream methods respectively. For example, to save a PDF export to a file you can use the following piece of code:
Saving the Active Page of a Drawing Document to PDF File |
Copy Code
|
NDrawingPdfExporter pdfExporter = new NDrawingPdfExporter(drawingView.Document);
pdfExporter.SaveToFile(@"C:\MyDocument.pdf");
|