Table of Contents

Method WritePages

Namespace
OpenCAD2D.Wpf
Assembly
OpenCAD2D.Rendering.dll

WritePages(string, CadDocument, IReadOnlyList<CadPlotJob>)

Writes plots of several spaces to one PDF file of a page each, in their order, replacing a file of the name, as EXPORTPDF writes All layouts: each page the size of its own sheet, stamped by its own settings, the stamp's lines added to its log once for each page.

public static IReadOnlyList<CadPlotPage> WritePages(string path, CadDocument document, IReadOnlyList<CadPlotJob> pages)

Parameters

path string

The file.

document CadDocument

The document.

pages IReadOnlyList<CadPlotJob>

The plot of each page: its space, its settings and the display it was asked with.

Returns

IReadOnlyList<CadPlotPage>

The plots as they were laid on their sheets, in the order of the pages.

Exceptions

ArgumentNullException

Thrown when an argument is null.

ArgumentException

Thrown when there is no page.

InvalidOperationException

Thrown when a page has nothing to plot.

WritePages(string, IReadOnlyList<CadDocument>, IReadOnlyList<CadPlotJob>)

Writes plots of spaces of several drawings to one PDF file of a page each, in their order, replacing a file of the name, as PUBLISH writes a multi-sheet PDF: the page of each plot is the size of its own sheet, its plot drawn from its own drawing, and stamped by its own settings. Three sheets, the model of one drawing and a layout on ISO A3 and one on ISO A1 of another, are a PDF of three pages.

public static IReadOnlyList<CadPlotPage> WritePages(string path, IReadOnlyList<CadDocument> documents, IReadOnlyList<CadPlotJob> pages)

Parameters

path string

The file.

documents IReadOnlyList<CadDocument>

The drawing of each page, as many as there are pages; the same drawing may stand for several.

pages IReadOnlyList<CadPlotJob>

The plot of each page: its space (of the drawing of the same place in documents), its settings and the display it was asked with.

Returns

IReadOnlyList<CadPlotPage>

The plots as they were laid on their sheets, in the order of the pages.

Exceptions

ArgumentNullException

Thrown when an argument is null.

ArgumentException

Thrown when there is no page, or the drawings are not as many as the pages.

InvalidOperationException

Thrown when a page has nothing to plot.

WritePages(string, IReadOnlyList<CadDocument>, IReadOnlyList<CadPlotJob>, IReadOnlyList<CadPdfBookmark>, Action<int>)

Writes plots of spaces of several drawings to one PDF file as WritePages(string, IReadOnlyList<CadDocument>, IReadOnlyList<CadPlotJob>) does, with an outline of bookmarks, and tells before each page is drawn. A published sheet set's PDF has one bookmark, Sheets and Views, and under it a bookmark for each page.

public static IReadOnlyList<CadPlotPage> WritePages(string path, IReadOnlyList<CadDocument> documents, IReadOnlyList<CadPlotJob> pages, IReadOnlyList<CadPdfBookmark> bookmarks, Action<int> beforePage)

Parameters

path string

The file.

documents IReadOnlyList<CadDocument>

The drawing of each page, as many as there are pages.

pages IReadOnlyList<CadPlotJob>

The plot of each page.

bookmarks IReadOnlyList<CadPdfBookmark>

The top bookmarks of the outline, each with those under it; null or empty for a PDF with no outline.

beforePage Action<int>

Called with the index of each page, from 0, before it is drawn; it may throw OperationCanceledException to stop, which writes no file. Null for none.

Returns

IReadOnlyList<CadPlotPage>

The plots as they were laid on their sheets, in the order of the pages.

Exceptions

ArgumentNullException

Thrown when the path, the drawings or the pages are null.

ArgumentException

Thrown when there is no page, the drawings are not as many as the pages, or a bookmark goes to a page the PDF has not.

InvalidOperationException

Thrown when a page has nothing to plot.

OperationCanceledException

Thrown when beforePage stops the writing.