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
pathstringThe file.
documentCadDocumentThe drawing.
layoutstringThe layout, or
Model; the space the drawing was left in where null.paperstringA sheet of the plotter's list (Paper(string)) for this plot; null for the layout's own.
scalestringA scale for this plot,
1:10,2:1or paper millimetres to the unit as0.1; null for the layout's own.fitboolTrue 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.