UNPKG

chromiumly

Version:

A lightweight Typescript library that interacts with Gotenberg's different modules to convert a variety of document formats to PDF files.

29 lines (28 loc) 1.88 kB
import { ConversionOptions, PathLikeOrReadStream } from './interfaces/libre-office.types'; /** * Class representing a LibreOffice for various operations such as merging and conversion. */ export declare class LibreOffice { /** * Converts various document formats to PDF. * * @param {Object} options - Options for the conversion operation. * @param {PathLikeOrReadStream[]} options.files - An array of PathLikes or ReadStreams to the files to be converted to PDF. * @param {PageProperties} [options.properties] - Page properties for the conversion. * @param {pdfa} [options.pdfFormat] - PDF format options. * @param {boolean} [options.pdfUA] - Indicates whether to generate PDF/UA compliant output. * @param {boolean} [options.merge] - Indicates whether to merge the resulting PDFs. * @param {Metadata} [options.metadata] - Metadata to be included in the converted PDF. * @param {boolean} [options.losslessImageCompression] - Indicates whether to use lossless image compression. * @param {boolean} [options.reduceImageResolution] - Indicates whether to reduce image resolution. * @param {number} [options.quality] - Quality of the JPG export. * @param {75 | 150 | 300 | 600 | 1200} [options.maxImageResolution] - Maximum image resolution for the converted PDF. * @param {Split} [options.split] - Split the PDF into multiple files. * @param {boolean} [options.flatten] - Flatten the PDF document. * * @returns {Promise<Buffer>} A Promise resolving to the converted PDF content as a buffer */ static convert({ files, properties, pdfa, pdfUA, merge, metadata, losslessImageCompression, reduceImageResolution, quality, maxImageResolution, split, flatten, userPassword, ownerPassword, embeds }: { files: PathLikeOrReadStream[]; } & ConversionOptions): Promise<Buffer>; }