Content

Export an object to a file

Changed on

Exports an object in one of the formats the editor's Export menu offers for it, and saves the file to the project as a reference: a document as pdf or docx, slides as pptx or pdf, a table as xlsx, a figure as png or svg. The file is the one the Export menu produces, with the same styles, page size, and headers and footers.

Download the bytes from file.contentUrl. PDF exports report pageCount, so a caller can check that a document fits.

The export runs on the server, in the same exporters the editor uses, whether or not anyone has the project open. The saved file is uncommitted until the branch is committed.

post/api/v2/projects/{projectId}/objects/{objectId}/exports

Request

  • Base URL
    https://davinci-app.com
  • Auth
    HTTP bearer

Query parameters

branchstring

Request body

formatstring required

A format the Export menu offers for the object, such as pdf, docx, pptx, xlsx, png, svg, or html. Case-insensitive. Print PDF, which ends in the browser's print dialog, is not offered.

displayTypestring

View to export, for objects with more than one (for example table or tree). Defaults to the view the object opens in.

dpiinteger

Resolution for raster content in PDF exports. Defaults to 300.

parentIdstring

Package to save the file in, such as the Library, 00000000-0000-0000-0000-00000library. Defaults to the exported object's parent.

Response

The object was exported and the file saved to the project.

objectIdstring required
formatstring required

The format exported, lower-case.

pageCountinteger nullable required

Number of pages, for PDF exports; null for other formats.

Changes