Table of Contents

Method WritePdf

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Rendering.dll

WritePdf(string, CadDocument, string, string, string, bool)

Plots a space to a PDF file of one page, replacing a file of the name, with the page setup of the layout as it is, or with the changes asked for, none of which is written into the drawing. A layout plotted at 1:50 on A3 with nothing asked for is written at 1:50 on A3; a space never set up (no sheet in its plot settings) is fitted to ISO A3; a sheet given with no scale is fitted to it.

public static CadPlotPage WritePdf(string path, CadDocument document, string layout, string paper, string scale, bool fit)

Parameters

path string

The file.

document CadDocument

The drawing.

layout string

The layout, or Model; the space the drawing was left in where null.

paper string

A sheet of the plotter's list (Paper(string)) for this plot; null for the layout's own.

scale string

A scale for this plot, 1:10, 2:1 or paper millimetres to the unit as 0.1; null for the layout's own.

fit bool

True to fit the plot to the sheet; not with a scale.

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, the sheet is not one the plotter lists, the scale is not above nought, or a scale and fit are both given.

InvalidOperationException

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