# createClassicEditorPdfPlugin

Registers PDF export and optional printing. Hosts provide fonts, images and semantic contributions and present export reports.

Registers PDF export and optional printing. Hosts provide fonts, images and semantic contributions and present export reports.

`@quirekit/classic-pdf` · **Commercial**

## Editor compatibility
Layer：**Classic product integration**
| Editor | Status | Assembly and boundaries |
| --- | --- | --- |
| Classic | Supported | Install this Classic product plugin in createClassicEditor plugins. Supply its required models, host ports and services as documented below. |
| Block | Unsupported | Block does not consume Classic product contributions, plugins or paginated assembly. Use shared capabilities and Block adapters instead of copying this entry's Classic configuration. |

“Supported” means the product assembly above exists; interaction, host services and file formats retain their own conditions. See [status and integration rules](/en/plugins/compatibility). Licensing is shown separately.

## Installation

The current `@quirekit/classic-pdf` manifest is private. This site uses workspace source; external projects need the relevant distribution package rather than assuming public npm availability.

This entry is a commercial component. Obtain distribution access and authorization first; installation commands require that distribution source.

Install the product plugin in createClassicEditor plugins rather than Core extensions. Required host ports are listed below.

```ts
import { createClassicEditorPdfPlugin } from '@quirekit/classic-pdf'

const pdf = createClassicEditorPdfPlugin({ fileName: 'report.pdf', print: false })
```

Use compatible versions available from your distribution source. This site uses the Alpha workspace. License labels come from package metadata; see [support and licensing](/en/support).

## Integration by editor

These snippets use an existing host element named element. The host owns container sizing and persistence; call instance.destroy() on teardown. Avoid duplicating preset capabilities and supply required host ports before installation.

### Classic

Install this Classic product plugin in createClassicEditor plugins. Supply its required models, host ports and services as documented below.

```ts
import { createClassicEditor } from '@quirekit/classic-editor'
import '@quirekit/classic-editor/styles.css'
import { createClassicWordDefaultDocument } from '@quirekit/classic-docx'
import { createClassicWordPreset } from '@quirekit/classic-docx'
import '@quirekit/classic-docx/styles.css'
import { createClassicEditorPdfPlugin } from '@quirekit/classic-pdf'

const instance = createClassicEditor({
  element,
  preset: createClassicWordPreset(),
  document: createClassicWordDefaultDocument(),
  plugins: [createClassicEditorPdfPlugin()],
})
```

### Block

Block does not consume Classic product contributions, plugins or paginated assembly. Use shared capabilities and Block adapters instead of copying this entry's Classic configuration.

## Configuration

Pass these fields to the factory options. Required ports come from the host. undefined means no explicit option; documented factory fallbacks apply.

### pluginId

Plugin id used when more than one product assembly is present.

Type：`string | undefined`

Default：`"classic.pdf"`

### serviceId

Registered document-service id.

Type：`string | undefined`

Default：`"pdf"`

### fileName

Suggested export file name including the `.pdf` extension.

Type：`string | undefined`

Default：`"document.pdf"`

### pageGeometry

Explicit page geometry; document Word section geometry wins when omitted.

Type：`QuirePageGeometry | undefined`

Default：`undefined`

### textMeasurer

Text measurer used by targetless full-document layout.

Type：`QuireTextMeasurer | undefined`

Default：`undefined`

### fonts

Explicit embeddable PDF font faces.

Type：`readonly QuirePdfFontSource[] | undefined`

Default：`undefined`

### loadFonts

Lazy font loader that overrides `fonts` when supplied.

Type：`ClassicEditorPdfFontLoader | undefined`

Default：`undefined`

### resolveImage

Host-owned image resolver.

Type：`QuirePdfImageResolver | undefined`

Default：`undefined`

### metadata

Optional PDF document information.

Type：`QuirePdfMetadata | undefined`

Default：`undefined`

### fallbackMode

Loss policy passed to the native PDF backend.

Type：`"diagnostic" | "strict" | undefined`

Default：`undefined`

### semanticContributors

Extension-owned non-paint semantic compilers appended after built-ins.

Type：`readonly ClassicEditorPdfSemanticContributor[] | undefined`

Default：`undefined`

### onReport

Optional structured report callback invoked after export completes.

Type：`((detail: ClassicEditorPdfExportReportDetail) => void) | undefined`

Default：`undefined`

### print

Whether to add the Print menu row and take over Ctrl/⌘+P; defaults to true.

Type：`false | true | undefined`

Default：`undefined`

## Commands and runtime

This entry declares no directly enumerable commands. Children supply bundle commands; product plugins use contributions or document services.

## Next steps

Return to [all plugins](/en/plugins), or read [configuration](/en/plugins/configuration) to distinguish options, attributes and commands.

Continue with [Classic quick start](/en/classic/quick-start) and [configuration/lifetime](/en/classic/configuration). See [product plugin development](/en/build/product-plugin) for your own UI and services.
