ICEfaces
  1. ICEfaces
  2. ICE-5208

Add PDF export to ice:dataExporter

    Details

    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
    • Community Contribution:
      Yes

      Description

      DataExporter could have a pdf export type.

        Activity

        Hide
        Tobin Tom added a comment -

        Hi,

        I have attached a ICEFaces data table PDF export component code and documentation. I used this with 1.8.2, but I am sure there would be a few changes to convert it to a JSF 1.2/2.0 standard, but after those changes the component should work just fine.

        Thanks,
        Tobin

        Show
        Tobin Tom added a comment - Hi, I have attached a ICEFaces data table PDF export component code and documentation. I used this with 1.8.2, but I am sure there would be a few changes to convert it to a JSF 1.2/2.0 standard, but after those changes the component should work just fine. Thanks, Tobin
        Hide
        Ken Fyten added a comment - - edited

        We need to be cautious with 3rd party libraries, such as iText. Since iText is LGPL licenses, we will not be able to distribute it in the product bundle. This means the the exportAdapter will need to be written using reflection or some other technique that will allow it to not fail with errors at runtime if the iText library is missing.

        Show
        Ken Fyten added a comment - - edited We need to be cautious with 3rd party libraries, such as iText. Since iText is LGPL licenses, we will not be able to distribute it in the product bundle. This means the the exportAdapter will need to be written using reflection or some other technique that will allow it to not fail with errors at runtime if the iText library is missing.
        Hide
        Mark Collette added a comment -

        Uses a Servlet instead of Resource api
        Exports data into Map in session, which Servlet then uses to create a PDF in memory, and serve out
        Doesn't seem to support ice:columns
        Doesn't seem to support footer rendering
        Doesn't use Converters

        Adds these properties to component:

        private String headerValue;
        private String orientation;
        private String pageSize;
        private String headerFont;
        private String cellFont;
        private String headerFontSize;
        private String cellFontSize;

        The code is organised to need all the cell data to calculate column widths, before the table is rendered, but this might be possible to set after. Have to investigate.
        PDF specific code is mostly contained in PDFExporterServlet, PDFGenerator, PageEvents

        Show
        Mark Collette added a comment - Uses a Servlet instead of Resource api Exports data into Map in session, which Servlet then uses to create a PDF in memory, and serve out Doesn't seem to support ice:columns Doesn't seem to support footer rendering Doesn't use Converters Adds these properties to component: private String headerValue; private String orientation; private String pageSize; private String headerFont; private String cellFont; private String headerFontSize; private String cellFontSize; The code is organised to need all the cell data to calculate column widths, before the table is rendered, but this might be possible to set after. Have to investigate. PDF specific code is mostly contained in PDFExporterServlet, PDFGenerator, PageEvents
        Hide
        Mark Collette added a comment -

        Didn't render the component when tested with Facelets, but did work with JSP. Was able to modify the code to calculate and set the column widths after receiving the column data, so can continue to use the standard callback approach.

        Show
        Mark Collette added a comment - Didn't render the component when tested with Facelets, but did work with JSP. Was able to modify the code to calculate and set the column widths after receiving the column data, so can continue to use the standard callback approach.
        Hide
        Mark Collette added a comment -

        Hard-coding the added font name/size properties to their defaults. Adding the properties would entail augmenting the Excel one to use them too, so that may end up being a separate enhancement jira.

        Show
        Mark Collette added a comment - Hard-coding the added font name/size properties to their defaults. Adding the properties would entail augmenting the Excel one to use them too, so that may end up being a separate enhancement jira.
        Hide
        Mark Collette added a comment -

        Got everything working as an OutputTypeHandler, just like the Excel and CSV exporting. Then changed all the code to use reflection, so that it will compile without iText, and will run and give an error if the PDF exporting code is run without iText. The component-showcase dataExporter example references the PDF exporting, even though the iText jar must be downloaded by application developers and manually included into war by them, since we can't distribute it.

        icefaces 1.8.2 P04
        Subversion 28718

        Show
        Mark Collette added a comment - Got everything working as an OutputTypeHandler, just like the Excel and CSV exporting. Then changed all the code to use reflection, so that it will compile without iText, and will run and give an error if the PDF exporting code is run without iText. The component-showcase dataExporter example references the PDF exporting, even though the iText jar must be downloaded by application developers and manually included into war by them, since we can't distribute it. icefaces 1.8.2 P04 Subversion 28718
        Hide
        Mark Collette added a comment -

        Added documentation for the dataExporter and the type property on it, listing the pdf export capability and giving the URL to download the iText jar from.

        icefaces 1.8.2 P04
        Subversion 28719

        Show
        Mark Collette added a comment - Added documentation for the dataExporter and the type property on it, listing the pdf export capability and giving the URL to download the iText jar from. icefaces 1.8.2 P04 Subversion 28719
        Hide
        Ken Fyten added a comment -

        For the Release Notes:

        The ice:dataExporter PDF exporter requires the 3rd party iText-2.1.7.jar. This jar is not included in the the ICEfaces release bundle due to its LGPL license. If you wish to use the PDF export function, you must first source the appropriate itext-2.x.x.jar and copy it in to the icefaces/samples/component-showcase/lib dir.

        Show
        Ken Fyten added a comment - For the Release Notes: The ice:dataExporter PDF exporter requires the 3rd party iText-2.1.7.jar. This jar is not included in the the ICEfaces release bundle due to its LGPL license. If you wish to use the PDF export function, you must first source the appropriate itext-2.x.x.jar and copy it in to the icefaces/samples/component-showcase/lib dir.
        Hide
        Mark Collette added a comment - - edited

        Adapted the code for icefaces3 compat dataExporter, and augmented showcase sample application to incorporate PDF exporting where appropriate. Fixed a showcase app issue where configurable column exporting would export in an unexpected sequence of columns.

        icefaces3 trunk
        Subversion 28735

        Show
        Mark Collette added a comment - - edited Adapted the code for icefaces3 compat dataExporter, and augmented showcase sample application to incorporate PDF exporting where appropriate. Fixed a showcase app issue where configurable column exporting would export in an unexpected sequence of columns. icefaces3 trunk Subversion 28735

          People

          • Assignee:
            Mark Collette
            Reporter:
            Stephane Douxc
          • Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: