Skip to main content

Read metadata

import { PDFEngines } from "chromiumly";

const metadataBuffer = await PDFEngines.readMetadata([
  "path/to/file_1.pdf",
  "path/to/file_2.pdf",
]);
Returns a buffer containing the metadata (format depends on Gotenberg). Typically used for inspection or debugging.

Write metadata

import { PDFEngines } from "chromiumly";

const buffer = await PDFEngines.writeMetadata({
  files: ["path/to/file_1.pdf", "path/to/file_2.pdf"],
  metadata: {
    Author: "Your Name",
    Title: "Document Title",
    Keywords: ["pdf", "chromiumly"],
  },
});
The metadata object uses standard PDF/XMP field names. For a full list of supported keys, see ExifTool PDF/XMP tag names.