cloudcad.export
The cloudcad.export namespace exports the CloudCAD drawing in the current session to other file formats.
cloudcad.export.pdf#
Export the current CloudCAD drawing as a PDF and return a link to download it.
important
cloudcad.model.create must be called earlier in the session, so there is a drawing to export.
By default, the pages and PDF settings come from the pdfExport object in the cad_data passed to cloudcad.model.create:
pdfExport.pdfPagesdefines the pages to print. It must be defined, either in the drawing or in thepdfPagesargument below.pdfExport.savedSettingscontrols the PDF settings.
Both can be overridden for a single export by passing them as arguments. All arguments are optional, so "arguments": {} exports the drawing as it is set up.
| Key | Type | Description |
|---|---|---|
quality | number | Render quality of the PDF. Defaults to 4. |
pdfPages | [object] | Pages to export. Overrides pdfExport.pdfPages in the drawing. See Page objects. |
savedSettings | object | PDF settings. Overrides pdfExport.savedSettings in the drawing. |
Page objects#
Each entry in pdfPages describes one printed page.
| Key | Type | Description |
|---|---|---|
frame | object | The page rectangle in canvas millimetres, as { "start": { "x", "y" }, "end": { "x", "y" } }. Remember that y is negative going up. |
format | string | Paper size, "A0" to "A4". Keep it consistent with the size of frame. |
orientation | string | "landscape" or "portrait". |
printPage | boolean | Include this page in the export. |
offset | object | Print margins, as { "top", "right", "bottom", "left" }. |
scale | number | Plot scale denominator, for example 100 for 1:100. |
canvasIndex | number | Index of the canvas in canvases that the page prints. |
Export using the pages and settings stored in the drawing:
Export a single A4 landscape page at 1:100 at a higher quality, overriding the drawing's pages:
cloudcad.model.create and cloudcad.export.pdf can be sent in the same request:
On success, data.download_link is a link to view or download the PDF:
If the export fails, for example because no pdfPages are defined, the response is:
See also#
cloudcad.modelโ create the drawing to export.cloudcad.fileโ save or open the drawing in SkyCiv cloud storage.- CAD Overview โ the full
cad_dataschema, includingpdfExport.