ImageWriterPng Class

class ImageWriterPng(file: File) : ImageWriter

Writes a scanned page to a PNG file.

PNG holds a single image, so each page becomes its own file. The first goes to the file given here and every page after it to a numbered sibling beside it — page.png, then page0001.png, page0002.png — and write returns the path it actually used, which is the only way to learn the later names.

Parameters

  • file — the file to write to. It is created if it does not exist and overwritten if it does.

Constructors

ImageWriterPng

constructor(file: File)

Functions

close

@Synchronized open override fun close()

Finish rendering and release the writer’s native memory.

setupFooter

open external fun setupFooter(text: String, url: String, height: ImageWriter.Dimension)

Adds a footer line to every page of the output.

setupPaper

open external fun setupPaper(paper: ImageWriter.Paper, orientation: ImageWriter.Paper.Orientation)

Sets the output page size from explicit measurements.

setupPaperSize

open external fun setupPaperSize(paperSize: ImageWriter.Paper.Size, orientation: ImageWriter.Paper.Orientation)

Sets the output page size from a standard paper size.

write

open external fun write(image: ScanPicture): File

Appends one page to the output file.

Top