|
|
Re: BIRT 2.5.1: IReportDocument.getPageNumber(bookMark) returns wrong page number? [message #513662 is a reply to message #513611] |
Wed, 10 February 2010 18:36 |
|
Steve,
The problem is that the bookmarks are based on the HTML pages not the
pdf pages. You will need to set page break intervals on your tables so
the HTML pages are equal to or smaller than the pdf pages to get this to
work like you want. BTW are you writting the TOC using iText?
Jason
Steve van den Buys wrote:
> I experimented a bit further and tried another path but that doesn't
> work either. I added a PDF Table Of Contents and in between the RunTask
> and the RenderTask I used the IReportDocument.findTOC(null) method to
> get the root TOC. I then iterated over the TOC to get the bookmarks and
> then used that bookmark to get the page number (I somehow hoped that
> this would work as the items in the TOC do link to the right page).
> Unfortunately: the page numbers are wrong here as well (apparently the
> linking of the TOC items to the actual PDF content is not based on page
> number).
|
|
|
|
|
|
Re: BIRT 2.5.1: IReportDocument.getPageNumber(bookMark) returns wrong page number? [message #513900 is a reply to message #513803] |
Thu, 11 February 2010 11:08 |
|
Steve,
I went through the same thing you did. I used BIRT to generate a PDF
with bookmarks and then used iText to write in a TOC at the beginning of
the PDF. This worked fine with the exception of not being able to get
the page numbers. The links worked, but I could not find a way in iText
to retrieve the page of a bookmark.
Are you using Fixed layout? I know we have a couple bugs in to address
this issue. You may want to try in the latest 2.5.2 or 2.6 build. We
also have a bug in to add a TOC to the beginning of a report.
Jason
Steve van den Buys wrote:
> Hmm, did some research in iText and it appears that my idea above isn't
> feasible either. Although you can use a PdfReader and something like the
> PdfStamper to manipulate an already existing PDF, this is rather limited
> (basically you can add stuff to a layer under or above the actual
> content but can't really manipulate existing content). Further: I'm
> still not able to get the relevant page numbers as the actual PDF
> bookmarks also refer to something else than a page number. And Bruno
> Lowagie (creator of iText for those who don't know) probably didn't
> write that section "Why you shouldn't use PDF as a format for editing"
> for nothing in his book "iText in Action"... :p
> Still, I'd expect more developers to sooner or later run into a client
> who asks (for more complex reports) for a table of contents with page
> numbers. Sure, you have the bookmarks and TOC functionality but once the
> report gets printed, a client no longer has that meta-data. And our
> particular client does exactly that: they have a web application where
> they can enter all their data which can then generate a report that is
> then printed and sent to their clients.
|
|
|
|
Re: BIRT 2.5.1: IReportDocument.getPageNumber(bookMark) returns wrong page number? [message #514145 is a reply to message #514067] |
Fri, 12 February 2010 15:02 |
|
Fixed layout attempts to honor page size and item positioning. Let us
know how your test go. It would be very cool if you could write
(blog/post) how you got the TOC on the first page. A lot of ppl ask for
this.
Jason
Steve van den Buys wrote:
> Jason,
>
> I was using Auto Layout but I just tried Fixed Layout and this works (at
> least for the example report)! So, with the setup as described in my
> first post (so no additional iText manipulation after BIRT report
> generation) this seems to work. But now I'll have to run a battery of
> tests to see if the page numbering is always correct for the report
> (given that the report design contains a lot of conditional logic and
> largely varying amounts of data from report to report).
>
> So what exactly is the big difference between Auto Layout and Fixed
> Layout that (at first sight) makes this work?
|
|
|
|
Re: BIRT 2.5.1: IReportDocument.getPageNumber(bookMark) returns wrong page number? [message #514165 is a reply to message #514162] |
Fri, 12 February 2010 16:40 |
|
Steve,
What happens when you set the page break interval to 20 on the toc list?
Jason
Steve van den Buys wrote:
> Well, testing seems to go pretty well with just one problem I can't
> really get my head around: page numbering is off by one page as soon as
> the actual table of contents itself jumps from 20 to 21 lines (so: it's
> correct when there are 20 or less lines and wrong from the moment there
> are more than 20 lines). Oddly enough the actual page break interval of
> the List that renders these lines is set to 30. So, I'm not sure what's
> going on here but it'd be great if I could figure this one out because
> apart from this everything works very well.
>
> Once I get this sorted out I'll try and write everything down!
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04684 seconds