bookmark action that goes to a page
- From: "Dan Crosta" <dcrosta (at) gmail.com>
- Date: Wed, 25 Oct 2006 16:21:01 -0400
Ok, I'm using:
PdfOutline bookmark = new PdfOutline(
writer.getRootOutline(),
new PdfDestination(
PdfDestination.XYZ,
0,
0,
0),
letter.getAttribute( "name" )
);
Which works except that the very first bookmark is on the top of page
2 (should be at top of page 1). Am I missing something? I call this
code at the same point in the loop for all bookmarks that are created,
and all the rest go to the correct page... let me explain.
The program generates a bunch of 2-page letters as a single PDF
document, driven by a big loop. Before I add any content to the page
I'm adding the bookmark with the above code. I've tried having this
both before and after the doc.newPage() call, but that doesn't seem to
make a difference. The very first time this is called (the time when
it goes "wrong" unless i'm misunderstanding something) the only itext
calls are:
Document doc = new Document( ... );
PdfWriter writer = PdfWriter.getInstance(doc, <outputstream>);
doc.open();
Rectangle pageSize = doc.getPageSize();
PdfContentByte pcb = writer.getDirectContent();
while ( <stuff to do> ) {
PdfOutline bookmark = new PdfOutline(
writer.getRootOutline(),
new PdfDestination(
PdfDestination.XYZ,
0,
0,
0),
letter.getAttribute( "name" )
);
doc.newPage();
<fill two pages of content>
}
any thoughts?
- d
On 10/25/06, Paulo Soares <psoares (at) consiste.pt> wrote:
> That's a XYZ destination with zoom 0.
>
> Paulo
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions