ujac-support Mailing List for Useful Java Application Components
Brought to you by:
lauerc
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: Bram <br...@uj...> - 2005-11-18 12:57:40
|
Hi, please see below ... I've included the patch needed for UJAC to get the keepTogether pdftable property working properly. This patch only works with the version of Itext that is currently in CVS though! Kind regards, Bram ----- Forwarded message from Bram <br...@it...> ----- From: Bram <br...@it...> To: ite...@li... Subject: iText - keeping tables on one page + patch X-Verification-Tag: brama@localhost Hi, I've been trying to generate PDF documents using a combination of iText and UJAC. The documents have multiple tables, always nested inside other containers. I noticed that, even though UJAC has a keepTogether attribute for tables, that tables are still split across two pages even if it would fit on a single page if a new page would have been started first. This only occurs when tables are nested inside other containers (chapters, sections), not when the table is directly added to a page. The keepTogether attribute works by calling PdfDocument's fitsPage method. However, after checking this the table is added to its current container and not committed to the document just yet. This only happens when the entire container embedding multiple tables is added to the document. Therefore, the fitsPage test is useless at this point because the content of the page only changes as the entire container is added. To fix this problem, I decided to move the fitsPage check to iText itself, when a PdfPTable object is actually added to the document directly. I've attached the patch (for the CVS repository) to do this. For it to work correctly, UJac also has to be patched because it has to set the (new) keepTogether attribute for PdfPTable objects. But that's for another mailing list.. I was hoping this could be included if deemed a sensible solution. If there was another solution that I somehow overlooked or if the problem is not clear, then I'd be more than hapy to hear about it. Regards, Bram ----- End forwarded message ----- -- Despite the cost of living, have you noticed how it remains so popular? |
|
From: Christian L. <la...@gm...> - 2004-08-18 22:54:55
|
Hi Brian, I've implemented the stuff a little different from what I've posted in my last message. Actually the TOC support for new items is added by extending the capabilites of the <outline> tag. Currently only <cell> tags and <paragraph> tags are perfectly supported, but other elements should work similar. The new attribute 'toc-number' tells the <outline> tag to generate a TOC entry. Here's an example: <table widths="20,40,40"> <cell><outline name="cellTest" toc-number="1.">Cell Test</outline>Cell Test</cell> <cell>regular cell</cell> <cell>regular cell 2</cell> </table> <paragraph><outline name="paraTest" toc-number="2.">Paragraph Test</outline>Paragraph Test</paragraph> Hope this works for you. Best regards, Christian |
|
From: Brian C. <bec...@ho...> - 2004-08-18 12:28:59
|
Hi Christian, Let me know if there's anything I can do to help. I actually started digging into the code to try to make these changes. But as I'm not familiar with the code or iText, it's slow going. I'm curious, when you get a minute, to know why the "position" is important (is position different then page number?). Here is what I kind of envisioned (and started to code). Keep in mind that I'm just looking at this from my perspective/needs and have not considered the bigger picture of document generation. Like you, I defined an element called <toc-item>. I envisioned its usage something like this: <toc-item level="1" title="ACME-21"/> - the title attribute is the textual string that is put in the TOC. - the level attribute determines the indentation level in the TOC. What I am trying to work up is a way to simply put in the above tag just before I insert a section (using 'section' generically, not as in <section>) of data in my reports ( 'section' could be a table, a graphic, etc. Pretty much anything). Now comes the gray (maybe black :-) ) area for me. In the current code, the page number and position gets assigned when the onSection/onChapter events are fired and handled. The same thing needs to happen for the <toc-item> but it probably needs its attributes filled in when the onEndPage event gets fired off. Thats about as far as I've gotten (I have only spent a couple of hours on it). Another idea that I had (but did not pursue because my needs for a report generator are immediate and it would take longer to implement) was to come up with a couple of new attributes and add them to several/most of the existing tag elements. Something like: <table ....... toc-title="foo" toc-level="1"> or <image ........ toc-title="Figure 1" toc-level="3"> or an idea for a table of figures <image ......... tof-title="Figure 1" tof-level="1"> etc Thanks for the info and help. Its greatly appreciated. -Brian > >Hi Brian, > >currently only sections and chapters are supported, because it's a >little tricky to get the position of an element out of iText. The >problem is that the position is generated when each object is written by >the document writer, so you have to handle events that iText creates to >get the positions of each element. This event handling is very specific >for the different interesting elements. > >To enable this for these elements (paragraph, cell, etc), I'll implement >a solution similar to the <outline> tag. The name of the tag will be ><toc-item>. Here's an example of what it could look like: > ><cell><toc-item level="1" number="1">Title</toc-item>Cell >contents</cell> > >I'll let you know when I've finished this stuff. > >Best regards, >Christian > >On Tue, 2004-08-17 at 14:08, Brian Campbell wrote: > > Hi, > > > > I've got a question regarding the TOC feature in the UJAC Print library. > > I've built a report that I want but now I want to add a TOC to the front >of > > the report. The doc/examples are very fuzzy when it comes to the TOC > > feature(s). I'm building a PDF that is a report so it doesn't have >chapters > > or sections. Is it possible to build a TOC without chapters/sections? > > Thanks in advance! > > > > -Brian > > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > _______________________________________________ > > ujac-support mailing list > > uja...@li... > > https://lists.sourceforge.net/lists/listinfo/ujac-support >-- >Christian Lauer <chr...@gm...> > > > >------------------------------------------------------- >SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media >100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 >Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. >http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 >_______________________________________________ >ujac-support mailing list >uja...@li... >https://lists.sourceforge.net/lists/listinfo/ujac-support |
|
From: Christian L. <chr...@gm...> - 2004-08-18 06:16:14
|
Hi Brian, currently only sections and chapters are supported, because it's a little tricky to get the position of an element out of iText. The problem is that the position is generated when each object is written by the document writer, so you have to handle events that iText creates to get the positions of each element. This event handling is very specific for the different interesting elements. To enable this for these elements (paragraph, cell, etc), I'll implement a solution similar to the <outline> tag. The name of the tag will be <toc-item>. Here's an example of what it could look like: <cell><toc-item level="1" number="1">Title</toc-item>Cell contents</cell> I'll let you know when I've finished this stuff. Best regards, Christian On Tue, 2004-08-17 at 14:08, Brian Campbell wrote: > Hi, > > I've got a question regarding the TOC feature in the UJAC Print library. > I've built a report that I want but now I want to add a TOC to the front of > the report. The doc/examples are very fuzzy when it comes to the TOC > feature(s). I'm building a PDF that is a report so it doesn't have chapters > or sections. Is it possible to build a TOC without chapters/sections? > Thanks in advance! > > -Brian > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > ujac-support mailing list > uja...@li... > https://lists.sourceforge.net/lists/listinfo/ujac-support -- Christian Lauer <chr...@gm...> |
|
From: Brian C. <bec...@ho...> - 2004-08-17 12:13:42
|
Hi, I've got a question regarding the TOC feature in the UJAC Print library. I've built a report that I want but now I want to add a TOC to the front of the report. The doc/examples are very fuzzy when it comes to the TOC feature(s). I'm building a PDF that is a report so it doesn't have chapters or sections. Is it possible to build a TOC without chapters/sections? Thanks in advance! -Brian |