Documentation
¶
Overview ¶
Package pdfrender rasterises a PDF page to an image in pure Go (CGO=0). It is a thin wrapper over github.com/go-pdfkit/render, shaped to plug straight into go-tex/engine's RasterizePDF seam:
engine.RasterizePDF = pdfrender.Rasterize
so \includegraphics of a vector .pdf figure typesets as a real raster. The engine core stays free of this (heavy) renderer; a consumer that wants PDF figures — the CLI, loom — opts in with the line above, while the browser/wasm build leaves the seam nil and shows a placeholder.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NumPages ¶ added in v0.2.0
NumPages reports how many pages a PDF document holds, or 0 when it cannot be opened. go-tex/engine's \includepdf needs it to resolve pdfpages' ranges — pages={2-5} and pages=- name a count the document alone knows — and counting "/Type /Page" in the bytes does not work on a PDF whose page tree lives in an object stream, which most modern writers produce.
Types ¶
This section is empty.