Skip to main content
All methods are static. They use the configured endpoint (and auth) from Chromiumly.configure().

convert(options)

Convert PDFs to PDF/A and/or PDF/UA.
PDFEngines.convert({
  files: PathLikeOrReadStream[];
  pdfa?: PdfFormat;
  pdfUA?: boolean;
  downloadFrom?: DownloadFrom;
}): Promise<Buffer>

merge(options)

Merge multiple PDFs into one.
PDFEngines.merge({
  files: PathLikeOrReadStream[];
  pdfa?: PdfFormat;
  pdfUA?: boolean;
  metadata?: Metadata;
  downloadFrom?: DownloadFrom;
  flatten?: boolean;
}): Promise<Buffer>

split(options)

Split PDFs by page range or intervals.
PDFEngines.split({
  files: PathLikeOrReadStream[];
  options: Split;  // { mode: 'pages' | 'intervals', span: string, unify?, flatten? }
}): Promise<Buffer>

flatten(files)

Flatten forms and annotations.
PDFEngines.flatten(files: PathLikeOrReadStream[]): Promise<Buffer>

readMetadata(files)

Read metadata from PDFs.
PDFEngines.readMetadata(files: PathLikeOrReadStream[]): Promise<Buffer>

writeMetadata(options)

Write metadata to PDFs.
PDFEngines.writeMetadata({
  files: PathLikeOrReadStream[];
  metadata: Metadata;  // key-value, e.g. Author, Title, Keywords
}): Promise<Buffer>

encrypt(options)

Encrypt PDFs with user and optional owner password.
PDFEngines.encrypt({
  files: PathLikeOrReadStream[];
  options: { userPassword: string; ownerPassword?: string };
}): Promise<Buffer>

embed(options)

Attach files to existing PDFs.
PDFEngines.embed({
  files: PathLikeOrReadStream[];   // PDFs to modify
  embeds: PathLikeOrReadStream[];  // files to attach
}): Promise<Buffer>

generate(filename, buffer)

Convenience: write a buffer to __generated__/<filename> in the current working directory.
PDFEngines.generate(filename: string, buffer: Buffer): Promise<void>
Creates __generated__ if it does not exist.