DisplayTag

Update PDF export to use iText 2.0

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Display Tag currently depends on iText 1.3 for its PDF exporting capability. 1.3 is an extremely old version of the iText library (circa 2005).

Our team is working on an application which makes use of both Display Tag and iText 2.0.x. The 2.0.x version brings many enhancements over prior versions. However, there's apparently quite a bit of refactoring (including deprecation of many classes) that went on in the iText codebase.

It would be nice to see Display Tag update this particular dependency.
  1. DISPL-450-DefaultItextExportView-patch.txt
    10/Jun/09 4:21 AM
    1 kB
    LusuM
  2. DISPL-450-DefaultPdfExportView-patch.txt
    16/Apr/08 6:27 AM
    1.0 kB
    Yannick Haudry
  3. DISPL-450-ItextTableWriter-patch.txt
    16/Apr/08 6:27 AM
    1 kB
    Yannick Haudry
  4. DISPL-450-ItextTotalWrapper-patch.txt
    16/Apr/08 6:27 AM
    1 kB
    Yannick Haudry
  5. DISPL-450-PdfView-patch.txt
    16/Apr/08 6:28 AM
    0.8 kB
    Yannick Haudry
  6. displaytag-itext-2.1.5.patch
    11/Aug/09 9:19 AM
    6 kB
    Josef Cacek

Activity

Hide
Yannick Haudry added a comment -
Here are the patches to make use of the latest iText version (tested with 2.0.8 and 2.1.0)
Basically nothing more than replacing deprecated methods (most of them since 2.0.3 and finally removed in 2.1.0)
Show
Yannick Haudry added a comment - Here are the patches to make use of the latest iText version (tested with 2.0.8 and 2.1.0) Basically nothing more than replacing deprecated methods (most of them since 2.0.3 and finally removed in 2.1.0)
Hide
LusuM added a comment -
There is actually a bug while using itext 2.0.x to export a multi-page table : if here is a caption the table headers don't appear on the first page (it only affect PDF not RTF)
To solve this issue you have to use the method setNotAddedYet(false) on the table before adding it into the itext document.
I joined the correction file DISPL-450-DefaultItextExportView-patch.txt
Cheers
Show
LusuM added a comment - There is actually a bug while using itext 2.0.x to export a multi-page table : if here is a caption the table headers don't appear on the first page (it only affect PDF not RTF) To solve this issue you have to use the method setNotAddedYet(false) on the table before adding it into the itext document. I joined the correction file DISPL-450-DefaultItextExportView-patch.txt Cheers
Hide
Josef Cacek added a comment -
All-in-one patch for update to iText 2.1.5
Show
Josef Cacek added a comment - All-in-one patch for update to iText 2.1.5
Hide
Corporate Gadfly added a comment -
when using DefaultPdfExportView.java with iText 2.1.6+, I had to use a couple of calls to cb.restoreState() at the end of doEndPage() method. iText 2.1.6+ now throws an exception:

From:
http://1t3xt.com/about/history.php?branch=history.21&node=216

Unbalanced saveState()/restoreState() calls to PdfContentByte now raises an IllegalPdfSyntaxException on close() and newPage()
Show
Corporate Gadfly added a comment - when using DefaultPdfExportView.java with iText 2.1.6+, I had to use a couple of calls to cb.restoreState() at the end of doEndPage() method. iText 2.1.6+ now throws an exception: From: http://1t3xt.com/about/history.php?branch=history.21&node=216 Unbalanced saveState()/restoreState() calls to PdfContentByte now raises an IllegalPdfSyntaxException on close() and newPage()
Hide
Mario Lavarreda added a comment -
Jar with patches for update to iText 2.1.5
Show
Mario Lavarreda added a comment - Jar with patches for update to iText 2.1.5
Hide
Samuel Wong added a comment -
I added the attached patch JAR to the classpath and PDF export is working. However the reported bug by LusuM is still showing up when I have a multi-page table.

First export page table will be missing the captions
Show
Samuel Wong added a comment - I added the attached patch JAR to the classpath and PDF export is working. However the reported bug by LusuM is still showing up when I have a multi-page table. First export page table will be missing the captions
Hide
Vance Cagle added a comment - - edited
The change in DefaultItextView should be setNotAddedYet(true) and not setNotAddedYet(false). This resolves the table header issue! (Using DisplayTag 1.2 and iText 2.1.3)
Show
Vance Cagle added a comment - - edited The change in DefaultItextView should be setNotAddedYet(true) and not setNotAddedYet(false). This resolves the table header issue! (Using DisplayTag 1.2 and iText 2.1.3)

People

Vote (9)
Watch (9)

Dates

  • Created:
    Updated: