Creating PDFs
This guide will show you how to create PDFs using the ScreenshotBuddy API.
Options
-
Name
urlTypestringDescriptionThe URL of the website you want to create a PDF of.
-
Name
pdfTypebooleanDescriptionMust be set to
trueto generate a PDF instead of a screenshot. -
Name
formatTypestringDescriptionThe paper format. Possible values are
letter,legal,tabloid,ledger,a0througha6. Defaults toa4. -
Name
landscapeTypebooleanDescriptionWhether to use landscape orientation. Defaults to
false(portrait). -
Name
widthTypenumberDescriptionCustom paper width. Must be used together with
height. Overridesformatwhen set. Unit is determined bymarginUnit(defaults to mm). -
Name
heightTypenumberDescriptionCustom paper height. Must be used together with
width. Overridesformatwhen set. Unit is determined bymarginUnit(defaults to mm). -
Name
marginTopTypenumberDescriptionTop margin. All four margins (
marginTop,marginRight,marginBottom,marginLeft) must be set together. -
Name
marginRightTypenumberDescriptionRight margin.
-
Name
marginBottomTypenumberDescriptionBottom margin.
-
Name
marginLeftTypenumberDescriptionLeft margin.
-
Name
marginUnitTypestringDescriptionThe unit for margins and custom paper size. Possible values are
mm,cm,in,px. Defaults tomm. -
Name
scaleTypenumberDescriptionThe scale of the webpage rendering. A value between
0.1and2. Defaults to1.