> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chromiumly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from Chromiumly 6

> Move from Chromiumly 6 on Gotenberg 8 to Chromiumly 7 on Gotenberg 9.

Chromiumly 7 targets Gotenberg 9. Gotenberg 9 renamed most fields, moved post-processing into ordered [stages](https://docs.chromiumly.dev/stages.md), and replaced the `/forms/pdfengines` routes with `/forms/pdf`. Most changes below follow [Gotenberg’s own upgrade guide](https://gotenberg.dev/docs/getting-started/upgrade).

> [!WARNING]
>
> Chromiumly 7 can't talk to Gotenberg 8, and Chromiumly 6 can't talk to Gotenberg 9. Staying on Gotenberg 8 for now? Keep Chromiumly 6 and its [6.x docs](https://docs.chromiumly.dev/v6/index.md).

## Steps

**1. Upgrade Gotenberg**

Move your image to `gotenberg/gotenberg:9`, and your Gotenberg configuration with it: see [Gotenberg’s upgrade guide](https://gotenberg.dev/docs/getting-started/upgrade) for its flags and environment variables.

**2. Upgrade Chromiumly**

Bump Chromiumly to `^7` with your package manager (see [Installation](https://docs.chromiumly.dev/installation.md)). The type declarations need TypeScript 5.0 or later.

**3. Update your calls**

Work through the tables below. TypeScript flags most changes, since the removed options and the renamed fields no longer type-check.

Ship the Gotenberg and Chromiumly upgrades together: in between, every request fails.

## PDFEngines becomes PDF

| Chromiumly 6 | Chromiumly 7 |
| - | - |
| `PDFEngines.merge()` | [`PDF.merge()`](https://docs.chromiumly.dev/pdf/pages#merge) |
| `PDFEngines.split({ options })` | [`PDF.split({ every })` or `PDF.split({ ranges })`](https://docs.chromiumly.dev/pdf/pages#split); [`PDF.select()`](https://docs.chromiumly.dev/pdf/pages#select-and-delete) for `unify` |
| `PDFEngines.flatten()` | [`PDF.flattenForm()`](https://docs.chromiumly.dev/pdf/forms#flatten) |
| `PDFEngines.convert({ pdfa, pdfUA })` | [`PDF.remediate({ profile })`](https://docs.chromiumly.dev/pdf/conformance) |
| `PDFEngines.readMetadata()` | [`PDF.metadata()`](https://docs.chromiumly.dev/pdf/metadata#read-the-metadata), which resolves to parsed JSON |
| `PDFEngines.writeMetadata({ metadata })` | [`PDF.setMetadata({ title, author, … })`](https://docs.chromiumly.dev/pdf/metadata): the eight standard fields |
| `PDFEngines.readBookmarks()` | [`PDF.bookmarks()`](https://docs.chromiumly.dev/pdf/metadata#bookmarks), which resolves to parsed JSON |
| `PDFEngines.writeBookmarks()` | [`PDF.setBookmarks()`](https://docs.chromiumly.dev/pdf/metadata#bookmarks): bookmarks take `pageNumber` instead of `page` |
| `PDFEngines.encrypt({ options })` | [`PDF.encrypt({ userPassword, ownerPassword, permissions })`](https://docs.chromiumly.dev/pdf/security#encrypt) |
| `PDFEngines.embed({ embeds })` | [`PDF.attach({ file })`](https://docs.chromiumly.dev/pdf/attachments), one file per call or per stage |
| `PDFEngines.watermark()` / `stamp()` | [`PDF.stampText()`, `PDF.stampImage()` or `PDF.stampPdf()`](https://docs.chromiumly.dev/pdf/stamps) |
| `PDFEngines.rotate()` | [`PDF.rotate()`](https://docs.chromiumly.dev/pdf/pages#rotate) |
| `PDFEngines.facturX({ facturx })` | [`PDF.remediate({ profile: "Factur-X", xml, level })`](https://docs.chromiumly.dev/pdf/conformance#factur-x) |
| `PDFEngines.generate()` | [`PDF.generate()`](https://docs.chromiumly.dev/pdf/overview#save-a-result) |

## Post-processing options become stages

On the Chromium and LibreOffice `convert()` methods, the post-processing options are gone. Add the matching stage to `stages`:

| Chromiumly 6 | Chromiumly 7 stage |
| - | - |
| `merge: true` (LibreOffice) | `{ op: "merge" }` |
| `split: { mode: "intervals", span }` | `{ op: "split", every }` |
| `split: { mode: "pages", span }` | `{ op: "split", ranges: [...] }`, or `{ op: "select", pages }` for `unify` |
| `pdfa`, `pdfUA`, `pdfFormat` | `{ op: "remediate", profile }`, or LibreOffice’s `nativePdfa`/`nativePdfua` |
| `metadata` | `{ op: "set-metadata", … }` |
| `userPassword`, `ownerPassword`, `allow*` | `{ op: "encrypt", userPassword, ownerPassword, permissions }` |
| `embeds`, `embedsMetadata` | `{ op: "attach", file, mimeType, relationship }`, one per file |
| `watermark`, `stamp` | `stamp-text`, `stamp-image` or `stamp-pdf`, always over the page |
| `rotate` | `{ op: "rotate", angle, pages }` |
| `flatten` | `{ op: "flatten-form" }` |
| `facturx` | `{ op: "remediate", profile: "Factur-X", xml, level }` |

Before and after:

```typescript Chromiumly 6 theme={null}
await new HtmlConverter().convert({
  html: "index.html",
  generateDocumentOutline: true,
  pdfFormat: PdfFormat.A_2b,
  metadata: { Title: "Report" },
  userPassword: "secret",
});
```

```typescript Chromiumly 7 theme={null}
await new HtmlConverter().convert({
  html: "index.html",
  nativeBookmarks: true,
  stages: [
    { op: "set-metadata", title: "Report" },
    { op: "remediate", profile: "PDF/A-2b" },
  ],
});
// A PDF/A can't be encrypted: encrypt in a separate request, without remediate.
```

Chromiumly 6's flat options ran in a fixed order on Gotenberg 8; stages run in the order you list them, under [order rules](https://docs.chromiumly.dev/stages.md#order-rules).

## Renamed fields

| Where | Chromiumly 6 | Chromiumly 7 |
| - | - | - |
| Chromium | `generateDocumentOutline` | `nativeBookmarks` |
| Chromium | `generateTaggedPdf` | `nativeTaggedPdf` |
| Chromium | `properties.nativePageRanges` | `properties.nativePages` |
| Chromium | `emulatedMediaFeatures: [{ name, value }]` | `emulatedMediaFeatures: { [name]: value }` |
| Screenshots | `quality`, 0 to 100 | `quality`, 1 to 100 |
| LibreOffice | `properties.nativePageRanges` | `properties.nativePages` |
| LibreOffice | `properties.singlePageSheets` | `properties.singlePage` |
| LibreOffice | `properties.exportBookmarks` | `properties.nativeBookmarks` |
| LibreOffice | `quality`, `losslessImageCompression`, `reduceImageResolution`, `maxImageResolution` | The same, prefixed with `native` |
| LibreOffice | `initialView`, `magnification`, `pageLayout` as numbers | Strings, such as `"thumbnails"`, `"fitWidth"`, `"twoColumnRight"` |
| LibreOffice | `nativeWatermarkColor`, a decimal number | `"#rrggbb"` |
| LibreOffice | `nativeWatermarkFontHeight`, `nativeWatermarkFontName` | `nativeWatermarkFontSize`, `nativeWatermarkFont` |
| LibreOffice | `nativeWatermarkRotateAngle`, in tenths of a degree | `nativeWatermarkRotation`, in degrees |
| LibreOffice | `firstPageOnLeft` | Removed |
| All | `downloadFrom[].embedded`, `downloadFrom[].field` | Removed: name the download in a stage with `{ name }` |

## Other changes

* `webhook` requires both `webhookUrl` and `webhookEventsUrl`; `webhookErrorUrl` and `webhookErrorMethod` are gone, and errors arrive as `webhook.error` events. See [Webhooks](https://docs.chromiumly.dev/advanced/webhooks.md).
* `System.getPrometheusMetrics()` is gone, with Gotenberg’s Prometheus route: Gotenberg 9 exports its metrics with OpenTelemetry.
* The `PdfFormat` enum and the `PdfEngine*` types are gone; use the `PdfaProfile`, `ConformanceProfiles` and stage types.
* LibreOffice no longer accepts `.epub`. Chromiumly uploads LibreOffice documents as `fileNN.<ext>`, and Gotenberg 9 names each PDF after its document, so a single document comes back as `file01.docx.pdf` unless you set `outputFilename`.
* The `PDF` read methods answer one entry per PDF under its file name: a path keeps its base name, a `Buffer` or `ReadStream` is `fileNN.pdf`, unless you pass `{ file, name }`.
* Two uploads under the same name now throw before the request is sent.

## New in Chromiumly 7

* Every [stage](https://docs.chromiumly.dev/stages.md), and a `PDF` method for each: insert, compose, redact, sign, timestamp, set-form, render, extract-text, and more.
* [Read methods](https://docs.chromiumly.dev/pdf/overview.md#read-pdfs) that answer typed JSON: `info`, `metadata`, `bookmarks`, `attachments`, `form`, `validate`.
* [`archives` and `downloadFrom[].filename`](https://docs.chromiumly.dev/advanced/files-and-downloads).
* `paperSize` on Chromium and LibreOffice, `waitForWindowStatus`, `failOnConsoleMessageTypes`, and the screenshot `selector`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.