Skip to main content
Static class. No constructor; call LibreOffice.convert(options).

convert(options)

import { LibreOffice } from "chromiumly";

const buffer = await LibreOffice.convert({
  files: (string | { data: Buffer | ReadStream; ext: string })[];
  properties?: { ... };  // page layout, password for protected source files
  pdfa?: PdfFormat;
  pdfUA?: boolean;
  merge?: boolean;
  metadata?: Metadata;
  lolosslessImageCompression?: boolean;
  reduceImageResolution?: boolean;
  quality?: number;  // 1–100, JPG export
  maxImageResolution?: 75 | 150 | 300 | 600 | 1200;
  flatten?: boolean;
  userPassword?: string;
  ownerPassword?: string;
  embeds?: PathLikeOrReadStream[];
});
Returns Promise<Buffer>. Supported input formats are listed in Gotenberg’s LibreOffice route docs. Each files entry is either a path string or { data, ext } for in-memory content.