public class PDFOutline extends PDFObject implements Serializable
Constructor and Description |
---|
PDFOutline(String title,
PDFPage dest)
Constructs a PDF Outline object.
|
PDFOutline(String title,
PDFPage dest,
int l,
int b,
int r,
int t)
Constructs a PDF Outline object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(PDFOutline outline)
This adds an already existing outline to this one.
|
PDFOutline |
add(String title,
PDFPage dest)
This method creates an outline, and attaches it to this one.
|
PDFOutline |
add(String title,
PDFPage dest,
int x,
int y,
int w,
int h)
This method creates an outline, and attaches it to this one.
|
Enumeration<PDFOutline> |
elements()
Returns all outlines directly below this one.
|
void |
write(OutputStream os)
Writes the object to the output stream.
|
getGeneration, getName, getPDFDocument, getSerialID, getType, setName, toArray, toString, writeEnd, writeStart
public PDFOutline(String title, PDFPage dest)
title
- Title of the outlinedest
- The destination pagepublic PDFOutline(String title, PDFPage dest, int l, int b, int r, int t)
title
- Title of the outlinedest
- The destination pagel
- left coordinateb
- bottom coordinater
- right coordinatet
- top coordinatepublic PDFOutline add(String title, PDFPage dest)
This allows you to have an outline for say a Chapter, then under the chapter, one for each section. You are not really limited on how deep you go, but it's best not to go below say 6 levels, for the reader's sake.
title
- Title of the outlinedest
- The destination pagepublic PDFOutline add(String title, PDFPage dest, int x, int y, int w, int h)
Note: the coordiates are in Java space. They are converted to User space.
This allows you to have an outline for say a Chapter, then under the chapter, one for each section. You are not really limited on how deep you go, but it's best not to go below say 6 levels, for the reader's sake.
title
- Title of the outlinedest
- The destination pagex
- coordinate of region in Java spacey
- coordinate of region in Java spacew
- width of region in Java spaceh
- height of region in Java spacepublic void add(PDFOutline outline)
Note: the outline must have been added to the PDF document before calling this method. Normally the other add methods are used.
outline
- PDFOutline to addpublic void write(OutputStream os) throws IOException
PDFObject
Writes the object to the output stream. This method must be overidden.
Note: It should not write any other objects, even if they are it's Kids, as they will be written by the calling routine.
write
in class PDFObject
os
- OutputStream to send the object toIOException
- on errorpublic Enumeration<PDFOutline> elements()