1) I've been laboring under an assumption: You're writing your chunks
to a PdfTemplate using ColumnText. Is that correct?
2) Ass-u-me'ing I'm right, lets proceed:
I just DID read through the relevant code. onGenericTag() is called
from PdfDocument.writeLineToContent(). ColumnText writes its lines out
to the PDF using... PdfDocument.writeLineToContent().
By my interpretation of the code, this means that your local gotos and
generic tags will fire ONCE, as you build the PdfTemplate. NOT each
time you add it to a page. That would be tough to "fix". PdfTemplate
(and its subclasses) would have to make a record of all the parameters
passed to each of the PdfPageEvent functions called while drawing to it,
then "play them back", in the same order, each time that PdfTemplate was
added to a given page. Nontrivial, but not impossible.
Just to make life More Exciting, the current PdfPageEvents object may
have changed from one page to the next. So should the recording be
played to the original Events object, or the new one?
I'm thinking this isn't going to be a high priority feature any time
soon.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
________________________________
From: Mark Storer [mailto:[email protected]]
Sent: Friday, March 25, 2011 10:03 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] problems about chunk
Hmm... an argument could be made that not firing the
OnGenericTag code a bug. onGenericTag's rect parameter might be a
little odd to calculate, but it should be possible.
And while you could make the same argument about the localGoTo,
there's a Significant Technical Hurdle there. Goto's are link
annotations on a page. A PdfTemplate can exist on multiple pages. I
haven't gone through the relevant code, but its also possible that the
PdfTemplate isn't a part of any page when we'd normally tack on the link
annotation.
In the meanwhile, you'll just have to work around the problem.
You'll have to create the link annotation[s] yourself with one
of the PdfAnnotation.createLink() overrides. Don't forget to call
setPage() on the returned link object before calling
PdfWriter.addAnnotation(). Note that you can use the same PdfAnnotation
instance on multiple pages IF they all link to exactly the same place &
page, and all exist in the same coordinates on each page.
PS: If you use one of the createLink()'s that takes a PdfAction,
you might be interested in the PdfAction constants FIRSTPAGE, PREVPAGE,
NEXTPAGE, and LASTPAGE. That would allow you to reuse the same link
annotation over and over for "prev" or "next" arrows.
--Mark Storer
Senior Software Engineer
Cardiff.com
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
________________________________
From: Colin Cheng [mailto:[email protected]]
Sent: Thursday, March 24, 2011 2:49 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] problems about chunk
I understand. However, I have to use template, cause I
don't know the correct text yet when I add the template.
On Thu, Mar 24, 2011 at 2:29 PM, Nurettin DAG
<[email protected]> wrote:
I believe those functions are only available
when you add the chunk via document.add but not through template.
On Thu, Mar 24, 2011 at 4:21 PM, Colin Cheng
<[email protected]> wrote:
Hi,
I'm not sure if the following issues are
bugs or not.
1. When I try to use
Chunk.setGenericTag() function, and the chunk is added to a PdfTemplate,
then it will not trigger the page's onGenericTag event.
2. When the chunk is about to be added
to a PdfTemplate, the chunk's setLocalGoto() will not function.
Please advise. Thanks a lot.
Colley
------------------------------------------------------------------------
------
Enable your software for Intel(R) Active
Management Technology to meet the
growing manageability and security
demands of your customers. Businesses
are taking advantage of Intel(R) vPro
(TM) technology - will your software
be a part of the solution? Download the
Intel(R) Manageability Checker
today!
http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of
1T3XT BVBA.
Many questions posted to this list can
(and will) be answered with a reference to the iText book:
http://www.itextpdf.com/book/
Please check the keywords list before
you ask for examples: http://itextpdf.com/themes/keywords.php
--
Nurettin DAG
------------------------------------------------------------------------
------
Enable your software for Intel(R) Active
Management Technology to meet the
growing manageability and security demands of
your customers. Businesses
are taking advantage of Intel(R) vPro (TM)
technology - will your software
be a part of the solution? Download the Intel(R)
Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT
BVBA.
Many questions posted to this list can (and
will) be answered with a reference to the iText book:
http://www.itextpdf.com/book/
Please check the keywords list before you ask
for examples: http://itextpdf.com/themes/keywords.php
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php