Package io.keikai.axyra.sheets.io
Class PdfOptions
java.lang.Object
io.keikai.axyra.sheets.io.PdfOptions
Options for PDF export (
Renderer.toPdf / Workbook.renderPdf).
Wide options type — construct through the PdfOptions.Builder
(PdfOptions.builder()…build()); toBuilder() supports
read–modify–write. Every field is optional; an empty options object renders
exactly like the plain toPdf(workbook, file) call.
- pageRange — 1-based selection over the final document, e.g.
"2-5,8". Pages beyond the document are dropped silently; a range that selects no pages fails with an exception. The output preserves document page order (a selection, not a reordering). - sheets / sheetNames — subset of sheets to export (union of both, workbook order). Default: all visible sheets. Explicitly selected sheets are exported even when hidden; an unknown name or out-of-range index fails.
- fitTo — page-scale override replacing each selected sheet's
own scale / fit-to-page setting:
PdfOptions.Fit.WIDTHfits all columns on one page width,PdfOptions.Fit.HEIGHTall rows on one page height,PdfOptions.Fit.PAGEthe whole sheet on a single page. - userPassword / ownerPassword / allow* — PDF encryption
(standard security handler, AES-128,
/V4 /R4 /AESV2). Setting either password encrypts the document; the user password is required to open it (empty = opens without a prompt), the owner password grants full access, and theallow*flags map to the standard permission bits (print / copy / modify). Flags default to allow.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enumFit-to-page override (ECMA-376 fitToWidth / fitToHeight semantics). -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether content copy / extraction is permitted (defaulttrue).booleanWhether document modification is permitted (defaulttrue).booleanWhether printing is permitted (encryption only; defaulttrue).author()Document author (PDF metadata), ornull.booleanWhether a PDF outline (one bookmark per exported sheet) is emitted.static PdfOptions.Builderbuilder()fitTo()The fit-to-page override, ornullto keep each sheet's own scaling.fontDirs()Extra directories scanned for fonts, on top of the host's own font paths.Password granting full access, ornull(falls back to the user password).The 1-based page selection (e.g.booleanpdfA()Whether the output is PDF/A-2b conformant (ISO 19005-2 level B).Selected sheet names (unmodifiable), ornull.int[]sheets()Selected sheet indices (copy), ornullwhen not restricted.title()Document title (PDF metadata), ornull.A builder pre-loaded with this value, for read–modify–write.Password required to open the document, ornull(no encryption unless owner set).Diagonal watermark text painted under every page's content, ornull.
-
Method Details
-
builder
-
toBuilder
A builder pre-loaded with this value, for read–modify–write. -
fontDirs
Extra directories scanned for fonts, on top of the host's own font paths.A workbook whose fonts are not installed on the rendering machine is drawn with substituted glyphs — every advance width changes, so text wraps and clips differently from the original. Pointing the renderer at the directory holding those font files is what makes the output match. Directories that do not exist are skipped rather than failing the render.
-
title
Document title (PDF metadata), ornull. -
author
Document author (PDF metadata), ornull. -
pageRange
The 1-based page selection (e.g."2-5,8"), ornull. -
sheets
public int[] sheets()Selected sheet indices (copy), ornullwhen not restricted. -
sheetNames
Selected sheet names (unmodifiable), ornull. -
fitTo
The fit-to-page override, ornullto keep each sheet's own scaling. -
userPassword
Password required to open the document, ornull(no encryption unless owner set). -
ownerPassword
Password granting full access, ornull(falls back to the user password). -
allowPrint
public boolean allowPrint()Whether printing is permitted (encryption only; defaulttrue). -
allowCopy
public boolean allowCopy()Whether content copy / extraction is permitted (defaulttrue). -
allowModify
public boolean allowModify()Whether document modification is permitted (defaulttrue). -
watermark
Diagonal watermark text painted under every page's content, ornull. -
bookmarks
public boolean bookmarks()Whether a PDF outline (one bookmark per exported sheet) is emitted. -
pdfA
public boolean pdfA()Whether the output is PDF/A-2b conformant (ISO 19005-2 level B).
-