Skip to main content

PdfFormat

enum PdfFormat {
  A_1a = "PDF/A-1a", // deprecated for LibreOffice from Gotenberg 7.6
  A_2b = "PDF/A-2b",
  A_3b = "PDF/A-3b",
}

PathLikeOrReadStream

string (file path), Buffer, or ReadStream (from fs).

PageProperties (converters)

PropertyTypeDefault / notes
singlePagebooleanfalse
size{ width, height } (number or string)width/height in inches (number) or units: pt, px, in, mm, cm, pc
marginsobject (top, bottom, left, right)same units as size
preferCssPageSizebooleanfalse
printBackgroundbooleanfalse
omitBackgroundbooleanfalse
landscapebooleanfalse
scalenumber1.0
nativePageRangesobject with from, to (numbers)

ImageProperties (screenshots)

PropertyTypeNotes
format'png' / 'jpeg' / 'webp'required
qualitynumber0–100, JPEG only
omitBackgroundboolean
widthnumberdefault 800
heightnumberdefault 600
clipbooleandefault false

Split

type Split = {
  mode: "pages" | "intervals";
  span: string; // e.g. "1-2", "1,3,5"
  unify?: boolean; // only for mode 'pages'
  flatten?: boolean;
};

Metadata

type Metadata = { [key: string]: boolean | number | string | string[] };
Use standard PDF/XMP keys (e.g. Author, Title, Keywords). See ExifTool PDF/XMP.

DownloadFrom

type DownloadFrom = {
  url: string;
  extraHttpHeaders?: Record<string, string>;
};
Used when the source is fetched from a URL that returns a Content-Disposition filename.
type Cookie = {
  name: string;
  value: string;
  domain: string;
  path?: string;
  secure?: boolean;
  httpOnly?: boolean;
  sameSite?: "Strict" | "Lax" | "None";
};

EmulatedMediaType / EmulatedMediaFeature

  • EmulatedMediaType: 'screen' or 'print'
  • EmulatedMediaFeature: object with name and value strings (e.g. prefers-color-scheme, prefers-reduced-motion)
Conversion options include the shared Chromium options (header, footer, wait*, extraHttpHeaders, failOn*, skipNetworkIdleEvent, cookies, downloadFrom, etc.) plus properties, pdfUA, metadata, split, userPassword, ownerPassword, embeds. See the source or Converters and Chromium options for the full list.