Package com.orsonpdf
Class Pages
- java.lang.Object
-
- com.orsonpdf.PDFObject
-
- com.orsonpdf.Pages
-
public final class Pages extends PDFObject
APDFObject
that maintains the list of pages for the document. When aPDFDocument
is created, it will create an instance ofPages
and add it to the document catalog. You won't normally interact directly with this class.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<FontKey,PDFFont>
fontMap
private FontMapper
fontMapper
private java.util.List<PDFFont>
fonts
The list of font objects used in the document.private int
nextFont
private java.util.List<Page>
pages
private PDFDocument
parent
The PDF document.
-
Constructor Summary
Constructors Constructor Description Pages(int number, int generation, PDFDocument parent)
Creates a newPages
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
add(Page page)
private Dictionary
createDictionary()
java.lang.String
findOrCreateFontReference(java.awt.Font f)
Finds or creates a font reference for the specified AWT font.PDFDocument
getDocument()
Returns the PDF document that the pages belong to.PDFFont
getFont(java.lang.String name)
Returns the PDF font with the specified name, ornull
if there is no font with that name.java.util.List<PDFFont>
getFonts()
Returns a list of fonts used in these pages.byte[]
getObjectBytes()
Returns the bytes that go between the 'obj' and 'endobj' in the PDF output for this object.java.util.List<Page>
getPages()
Returns a list of the pages in this object.-
Methods inherited from class com.orsonpdf.PDFObject
getGeneration, getNumber, getReference, toPDFBytes
-
-
-
-
Field Detail
-
parent
private PDFDocument parent
The PDF document.
-
pages
private java.util.List<Page> pages
-
fonts
private java.util.List<PDFFont> fonts
The list of font objects used in the document.
-
nextFont
private int nextFont
-
fontMapper
private FontMapper fontMapper
-
-
Constructor Detail
-
Pages
Pages(int number, int generation, PDFDocument parent)
Creates a newPages
object.- Parameters:
number
- the PDF object number.generation
- the PDF object generation number.parent
- the PDF document (null
not permitted).
-
-
Method Detail
-
getDocument
public PDFDocument getDocument()
Returns the PDF document that the pages belong to.- Returns:
- The PDF document (never
null
).
-
getPages
public java.util.List<Page> getPages()
Returns a list of the pages in this object.- Returns:
- A list of the pages.
-
getFonts
public java.util.List<PDFFont> getFonts()
Returns a list of fonts used in these pages.- Returns:
- A list of fonts.
-
getFont
public PDFFont getFont(java.lang.String name)
Returns the PDF font with the specified name, ornull
if there is no font with that name.- Parameters:
name
- the font name.- Returns:
- The PDF font or
null
.
-
add
void add(Page page)
- Parameters:
page
-
-
findOrCreateFontReference
public java.lang.String findOrCreateFontReference(java.awt.Font f)
Finds or creates a font reference for the specified AWT font.- Parameters:
f
- the font (null
not permitted).- Returns:
- The font reference.
-
createDictionary
private Dictionary createDictionary()
-
getObjectBytes
public byte[] getObjectBytes()
Description copied from class:PDFObject
Returns the bytes that go between the 'obj' and 'endobj' in the PDF output for this object.- Specified by:
getObjectBytes
in classPDFObject
- Returns:
- A byte array.
-
-