From 6fab474f108f49f6c53e354373f37ccccda58832 Mon Sep 17 00:00:00 2001 From: DomCR Date: Mon, 4 Nov 2024 19:15:32 +0100 Subject: [PATCH] basic examples --- .../PdfExporterExamples.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/ACadSharp.Pdf.Examples/PdfExporterExamples.cs diff --git a/src/ACadSharp.Pdf.Examples/PdfExporterExamples.cs b/src/ACadSharp.Pdf.Examples/PdfExporterExamples.cs new file mode 100644 index 0000000..4b23c75 --- /dev/null +++ b/src/ACadSharp.Pdf.Examples/PdfExporterExamples.cs @@ -0,0 +1,35 @@ +namespace ACadSharp.Pdf.Examples +{ + public static class PdfExporterExamples + { + /// + /// Example of how to print the model space in a pdf page. + /// + /// + /// + public static void AddModelSpace(CadDocument document, string pdfPath) + { + PdfExporter exporter = new PdfExporter(pdfPath); + + //Add the model space into the file, page size will be adapted to include all entities + exporter.AddModelSpace(document); + + exporter.Close(); + } + + /// + /// Example of how to add all paper layouts into the pdf document. + /// + /// + /// + public static void AddPaperLayout(CadDocument document, string pdfPath) + { + PdfExporter exporter = new PdfExporter(pdfPath); + + //Add all paper layouts in the pdf document + exporter.AddPaperLayouts(document); + + exporter.Close(); + } + } +}