Class PdfOptions

java.lang.Object
io.keikai.axyra.sheets.io.PdfOptions

public final class PdfOptions extends Object
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.WIDTH fits all columns on one page width, PdfOptions.Fit.HEIGHT all rows on one page height, PdfOptions.Fit.PAGE the 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 the allow* flags map to the standard permission bits (print / copy / modify). Flags default to allow.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
    static enum 
    Fit-to-page override (ECMA-376 fitToWidth / fitToHeight semantics).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether content copy / extraction is permitted (default true).
    boolean
    Whether document modification is permitted (default true).
    boolean
    Whether printing is permitted (encryption only; default true).
    Document author (PDF metadata), or null.
    boolean
    Whether a PDF outline (one bookmark per exported sheet) is emitted.
     
    The fit-to-page override, or null to keep each sheet's own scaling.
    Extra directories scanned for fonts, on top of the host's own font paths.
    Password granting full access, or null (falls back to the user password).
    The 1-based page selection (e.g.
    boolean
    Whether the output is PDF/A-2b conformant (ISO 19005-2 level B).
    Selected sheet names (unmodifiable), or null.
    int[]
    Selected sheet indices (copy), or null when not restricted.
    Document title (PDF metadata), or null.
    A builder pre-loaded with this value, for read–modify–write.
    Password required to open the document, or null (no encryption unless owner set).
    Diagonal watermark text painted under every page's content, or null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • builder

      public static PdfOptions.Builder builder()
    • toBuilder

      public PdfOptions.Builder toBuilder()
      A builder pre-loaded with this value, for read–modify–write.
    • fontDirs

      public List<String> 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

      public String title()
      Document title (PDF metadata), or null.
    • author

      public String author()
      Document author (PDF metadata), or null.
    • pageRange

      public String pageRange()
      The 1-based page selection (e.g. "2-5,8"), or null.
    • sheets

      public int[] sheets()
      Selected sheet indices (copy), or null when not restricted.
    • sheetNames

      public List<String> sheetNames()
      Selected sheet names (unmodifiable), or null.
    • fitTo

      public PdfOptions.Fit fitTo()
      The fit-to-page override, or null to keep each sheet's own scaling.
    • userPassword

      public String userPassword()
      Password required to open the document, or null (no encryption unless owner set).
    • ownerPassword

      public String ownerPassword()
      Password granting full access, or null (falls back to the user password).
    • allowPrint

      public boolean allowPrint()
      Whether printing is permitted (encryption only; default true).
    • allowCopy

      public boolean allowCopy()
      Whether content copy / extraction is permitted (default true).
    • allowModify

      public boolean allowModify()
      Whether document modification is permitted (default true).
    • watermark

      public String watermark()
      Diagonal watermark text painted under every page's content, or null.
    • 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).