Package io.github.jbastgen.stemma.app.io
Class PdfDocument
java.lang.Object
io.github.jbastgen.stemma.app.io.PdfDocument
Writes a PDF whose pages are pictures (JPEG): the page of the document looks exactly like what was drawn, in every script, and no font
has to be embedded. The text of such a PDF cannot be selected or searched; the title, the page numbers and the creation date are real
PDF text and data. Only what this needs of the format is written: catalog, pages, one image per page, the standard font Helvetica
for the footer, the information dictionary, and the cross-reference table.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doublestatic final doubleA4 in points. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPage(PdfDocument.Page page) Adds a page: a picture centred below the top margin, with the footer under it.intpages()The number of pages.byte[]toBytes()The PDF file: header, catalog, page tree, font, information, one page with its content and image per page, the cross-reference table and the trailer.
-
Field Details
-
PAGE_WIDTH
public static final double PAGE_WIDTHA4 in points.- See Also:
-
PAGE_HEIGHT
public static final double PAGE_HEIGHT- See Also:
-
-
Constructor Details
-
PdfDocument
- Parameters:
footer- text at the bottom of every page, before "Page n of m" (plain ASCII; other characters become?)margin- space around the pictures, in points
-
-
Method Details
-
addPage
Adds a page: a picture centred below the top margin, with the footer under it. -
pages
public int pages()The number of pages. -
toBytes
The PDF file: header, catalog, page tree, font, information, one page with its content and image per page, the cross-reference table and the trailer.- Throws:
IOException- when writing to memory fails (does not happen in practice)
-