@mlightcad/pdf-renderer
v1.7.6
Published
[](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@mlightcad/pdf-renderer)
Maintainers
Readme
@mlightcad/pdf-renderer
Native AcGi PDF renderer for @mlightcad/data-model. Converts a drawing database to a vector PDF without going through SVG or a viewer.
This package does not depend on @mlightcad/cad-simple-viewer. Viewer integration lives in @mlightcad/cad-pdf-plugin.
Export includes patterned and gradient hatches, SHX/mesh glyph paths with /ActualText, OCG layers, INSERT marked content (layer 0 follows the INSERT), complex linetype walking, Form XObject reuse, and optional multi-layout (paper space) pages.
Usage
import { AcDbDatabase } from '@mlightcad/data-model'
import { exportDatabaseToPdf } from '@mlightcad/pdf-renderer'
const db: AcDbDatabase = /* loaded drawing */
const bytes = await exportDatabaseToPdf(db, {
showLineWeight: true,
background: 'none'
})Build
pnpm --filter @mlightcad/pdf-renderer build