Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

Re: [iText-questions] Concatenating with gotos and destinations

Dan Kaplan

2007-10-04

Replies:

Although Paulo's suggestion is helpful, I decided to go with something else
that's easier for my program to use (since I'm using flying saucer). I
thought I'd share it to help the next person:
I made it so that all the anchors I add use javascript where they set
app.pageNum = x. You're allowed to do this with an x that is larger than
the number of pages. After this, you concatenate your documents together
and when you click on the anchor it will jump to that page.

I personally ended up doing this with "
this.bookmarkRoot.children[2].execute()" because it's easy to add a document
to the first page of every appended document.

The latest version of flying saucer doesn't allow javascript on anchors but
I provided a patch that allows anchors to evaluate onclick events. If you
get the latest from cvs you can use this functionality too.

-----Original Message-----
From: itext-questions-bounces@(protected)
[mailto:itext-questions-bounces@(protected)
Kaplan
Sent: Tuesday, October 02, 2007 11:15 AM
To: 'Post all your questions about iText here'
Subject: Re: [iText-questions] Concatenating with gotos and destinations

Thanks, I *think* I've figured it out. I didn't realize that PdfWriter had
a method named getImportedPage

-----Original Message-----
From: itext-questions-bounces@(protected)
[mailto:itext-questions-bounces@(protected)
Kaplan
Sent: Tuesday, October 02, 2007 10:51 AM
To: 'Post all your questions about iText here'
Subject: Re: [iText-questions] Concatenating with gotos and destinations

Thanks for the reply!

What method do I use to create the links? I tried using a goto in A that
refers to a destination that exists in B but itext threw an exception saying
that the destination didn't exist.

Thanks again,
Dan
-----Original Message-----
From: itext-questions-bounces@(protected)
[mailto:itext-questions-bounces@(protected)
Soares
Sent: Tuesday, October 02, 2007 7:34 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Concatenating with gotos and destinations

Use a normal PdfWriter. Create the first page with the links to future
pages. In those future pages place B and C as imported pages. You'll
lose the links in B and C.

If it's important to keep the interactive features in B and C then:

- Create A with the onGenericTag event to know the activation area of
the future links.
- Concatenate A, B and C with PdfCopy.
- Open the resulting PDF with PdfStamper and apply the links in the
positions previously determined.

Paulo

> -----Original Message-----
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of Dan Kaplan
> Sent: Monday, October 01, 2007 11:55 PM
> To: 'Post all your questions about iText here'
> Subject: Re: [iText-questions] Concatenating with gotos and
> destinations
>
> I'm very sorry to nag about this, but can anyone help me with
> this question? I've searched the archives/examples before I
> asked and couldn't find an answer.
>
>
>
> ________________________________
>
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of Dan Kaplan
> Sent: Monday, October 01, 2007 11:12 AM
> To: 'Post all your questions about iText here'
> Subject: Re: [iText-questions] Concatenating with gotos and
> destinations
>
>
>
> Heh, ok, well how do you do it? I've tried some ideas: I
> tried using a stamper to put a destination in document B.
> But when I created document A with the goto, it gave an
> exception because the destination didn't exist (since it
> wasn't appended yet).
>
>
>
> Can you give me some advice on how to accomplish this?
>
>
>
> Thanks,
>
> Dan
>
>
>
> ________________________________
>
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of Leonard Rosenthol
> Sent: Monday, October 01, 2007 11:02 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Concatenating with gotos and
> destinations
>
>
>
> Yes, you can do this.
>
>
>
> Leonard
>
>
>
> On Oct 1, 2007, at 1:36 PM, Dan Kaplan wrote:
>
>
>
> Hi, I think my question was overlooked or ignored. If my
> question was unclear I'll gladly restate it. Otherwise... is
> my request possible?
>
>
>
> ________________________________
>
> From: Dan Kaplan [mailto:dkaplan@(protected)]
> Sent: Thursday, September 27, 2007 3:47 PM
> To: 'itext-questions@(protected)'
> Subject: Concatenating with gotos and destinations
>
>
>
> Hello,
>
>
>
> I'm concatenating 3 pdf's together: A, B and C. I'm making A
> myself and A is going to have text in it that says, "please
> see B for an example". I'd really like that text to be a
> link that you can click on and it'll make you jump to the
> beginning of B. Is it possible to do this with iText?
>
>
>
> Thanks,
>
> Dan


Aviso Legal:

Esta mensagem i destinada exclusivamente ao destinatario. Pode conter
informagco confidencial ou legalmente protegida. A incorrecta transmissco
desta mensagem nco significa a perca de confidencialidade. Se esta mensagem
for recebida por engano, por favor envie-a de volta para o remetente e
apague-a do seu sistema de imediato. I proibido a qualquer pessoa que nco o
destinatario de usar, revelar ou distribuir qualquer parte desta mensagem.



Disclaimer:

This message is destined exclusively to the intended receiver. It may
contain confidential or legally protected information. The incorrect
transmission of this message does not mean the loss of its confidentiality.
If this message is received by mistake, please send it back to the sender
and delete it from your system immediately. It is forbidden to any person
who is not the intended receiver to use, distribute or copy any part of this
message.





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.