Skip to content

Commit

Permalink
basic examples
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Nov 4, 2024
1 parent 775ef08 commit 6fab474
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/ACadSharp.Pdf.Examples/PdfExporterExamples.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace ACadSharp.Pdf.Examples
{
public static class PdfExporterExamples
{
/// <summary>
/// Example of how to print the model space in a pdf page.
/// </summary>
/// <param name="document"></param>
/// <param name="pdfPath"></param>
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();
}

/// <summary>
/// Example of how to add all paper layouts into the pdf document.
/// </summary>
/// <param name="document"></param>
/// <param name="pdfPath"></param>
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();
}
}
}

0 comments on commit 6fab474

Please # to comment.