Package io.keikai.axyra.sheets.io
Class ImageOptions.Builder
java.lang.Object
io.keikai.axyra.sheets.io.ImageOptions.Builder
- Enclosing class:
- ImageOptions
Fluent builder for
ImageOptions; see ImageOptions.builder().-
Method Summary
Modifier and TypeMethodDescriptionaddFontDir(String dir) Adds one directory tofontDirs(java.util.List).build()Builds immutable options; later builder calls do not change them.Sets the extra directories scanned for fonts, on top of the host's own font paths, replacing any set before.gridLines(boolean show) Forces gridlines on or off.page(int page) Renders the given printed page, 1-based over the sheet's print pagination (the numbering the PDF export uses).scale(double scale) Sets the zoom over the 96-DPI base: 1.0 = 96 DPI (1 pt = 4/3 px), 2.0 = 192 DPI.targetWidthPx(int widthPx) Sets the exact output width in pixels.
-
Method Details
-
scale
Sets the zoom over the 96-DPI base: 1.0 = 96 DPI (1 pt = 4/3 px), 2.0 = 192 DPI. Applies to raster output (PNG, JPEG, GIF, BMP, TIFF) only; SVG output is sized in points and ignores it. Ignored whentargetWidthPx(int)is set.- Parameters:
scale- the zoom; 0.01 or below, and NaN, are treated as 0.01. A scale that makes the image too large makes the render call throwAxyraException- Returns:
- this builder
-
targetWidthPx
Sets the exact output width in pixels. The height keeps the page's aspect ratio, and this overridesscale(double). Raster output only; SVG ignores it.- Parameters:
widthPx- the width in pixels; 0 gives a 1-pixel-wide image, and a negative width makes the render call throwAxyraException- Returns:
- this builder
-
gridLines
Forces gridlines on or off. Without this call the sheet's own print-gridlines setting applies.- Parameters:
show-trueto draw gridlines- Returns:
- this builder
-
page
Renders the given printed page, 1-based over the sheet's print pagination (the numbering the PDF export uses). Default: page 1. An empty sheet renders page 1 as a blank page at its paper size. UseRenderer.pageCount(io.keikai.axyra.sheets.Workbook, int)for the number of pages.- Parameters:
page- the 1-based page; page 0, a negative page, or a page pastRenderer.pageCount(io.keikai.axyra.sheets.Workbook, int)makes the render call throwAxyraException- Returns:
- this builder
-
fontDirs
Sets the extra directories scanned for fonts, on top of the host's own font paths, replacing any set before.A workbook whose fonts are not installed on the rendering machine is drawn with substitute fonts. Every character width then changes, so text wraps and clips differently from the original. Point the renderer at the directory that holds those font files to make the output match. Directories that do not exist are skipped; they do not fail the render.
- Parameters:
dirs- directory paths;nullclears the list- Returns:
- this builder
-
addFontDir
Adds one directory tofontDirs(java.util.List).- Parameters:
dir- the directory path;nullor empty is ignored- Returns:
- this builder
-
build
Builds immutable options; later builder calls do not change them.- Returns:
- the options
-