|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.jpdf.PDFObject
gnu.jpdf.PDFOutline
public class PDFOutline
This class manages the documents outlines (also known as bookmarks).
Field Summary | |
---|---|
protected PDFOutline |
parent
For subentries, this points to it's parent outline |
Fields inherited from class gnu.jpdf.PDFObject |
---|
objser, pdfDocument |
Constructor Summary | |
---|---|
protected |
PDFOutline()
Constructs a PDF Outline object. |
|
PDFOutline(java.lang.String title,
PDFPage dest)
Constructs a PDF Outline object. |
|
PDFOutline(java.lang.String title,
PDFPage dest,
int l,
int b,
int r,
int t)
Constructs a PDF Outline object. |
Method Summary | |
---|---|
void |
add(PDFOutline outline)
This adds an already existing outline to this one. |
PDFOutline |
add(java.lang.String title,
PDFPage dest)
This method creates an outline, and attaches it to this one. |
PDFOutline |
add(java.lang.String title,
PDFPage dest,
int x,
int y,
int w,
int h)
This method creates an outline, and attaches it to this one. |
protected int |
descendants()
Returns the total number of descendants below this one. |
java.util.Enumeration |
elements()
Returns all outlines directly below this one. |
protected int |
getIndex(PDFOutline outline)
This is called by children to find their position in this outlines tree. |
protected int |
getLast()
Returns the last index in this outline |
protected PDFOutline |
getNode(int i)
Returns the outline at a specified position. |
void |
write(java.io.OutputStream os)
Writes the object to the output stream. |
Methods inherited from class gnu.jpdf.PDFObject |
---|
getPDFDocument, getSerialID, getType, toArray, toString, writeEnd, writeStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PDFOutline parent
Constructor Detail |
---|
protected PDFOutline()
public PDFOutline(java.lang.String title, PDFPage dest)
title
- Title of the outlinedest
- The destination pagepublic PDFOutline(java.lang.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 coordinateMethod Detail |
---|
public PDFOutline add(java.lang.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 page
public PDFOutline add(java.lang.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 space
public 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(java.io.OutputStream os) throws java.io.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 to
java.io.IOException
- on errorprotected int getIndex(PDFOutline outline)
outline
- PDFOutline to search for
protected int getLast()
protected PDFOutline getNode(int i)
i
- index
public java.util.Enumeration elements()
protected int descendants()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |