Appearance
Generate a PDF
POST /generate
Generates a new PDF for the given templateUrl
and projectId
.
Request Body
projectId
number requiredtemplateUrl
string requiredassetContentDisposition?
stringSets the
Content-Disposition
for the file being saved. This specifies how the browser handles the object's content. It controls whether the content is displayed inline in the browser or treated as an attachment for download. This header is useful for prompting users to download a file instead of viewing it directly in their browser.For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4
format?
The valid paper format types for printing a PDF include several different sizes. These sizes are:
Letter
8.5in x 11inLegal
8.5in x 14inTabloid
11in x 17inLedger
17in x 11inA0
33.1in x 46.8inA1
23.4in x 33.1inA2
16.54in x 23.4inA3
11.7in x 16.54inA4
8.27in x 11.7inA5
5.83in x 8.27inA6
4.13in x 5.83in
height?
number | stringSets the height of paper. You can pass in a number or a string with a unit.
landscape?
boolean - defaultfalse
Whether to print in landscape orientation.
preferCSSPageSize?
boolean - defaultfalse
Give any CSS @page size declared in the page priority over what is declared in the width or height or format option.
puppeteerOptions?
objectpuppeteerOptions.waitUntil?
viewport?
objectThe viewport to be used before navigating to the
templateUrl
, helps with establishing the correct media queries and CSS layout.Note:
width
andheight
must be provided.viewport.width
number
The page height in pixels.
viewport.height
number
The page width in pixels.
width?
number | stringSets the width of paper. You can pass in a number or a string with a unit.