Table of Contents

Method WritePdf

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Rendering.dll

WritePdf(string, CadDocument, string)

Plots a space of a drawing to a PDF file of one page, replacing a file of the name, as EXPORTPDF does: the page setup of the layout (its sheet, scale and plot style), the lines at the lineweights of the plot, text as text, and for model space the extents. An A3 sheet on its side is 1 190.5512 by 841.8898 points. A space with no sheet recorded in its plot settings (a drawing made in code, never set up) is fitted to the default sheet, ISO A3, as AutoCAD fits a page setup it has not been given; one with a sheet is plotted at the scale it records.

public static CadPlotPage WritePdf(string path, CadDocument document, string layout)

Parameters

path string

The file.

document CadDocument

The drawing.

layout string

The layout, or "Model", as Layout says; null for the space the drawing was left in.

Returns

CadPlotPage

The plot as it was laid on its sheet.

Exceptions

ArgumentNullException

Thrown when the path or the document is null.

ArgumentException

Thrown when the layout is not in the drawing.

InvalidOperationException

Thrown when the plot area is empty: there is nothing to plot.

IOException

Thrown when the file cannot be written.