Best approach on generating report of mutiple data types

  • I'm stuck at starting point. My task is to generate a report based on the supported datatypes of a filing system. Initially this is narrowed down to rtf and multipage tiff.

    The report is to have a header and footer, so the documents and tiff's within therefore need to be scaled down to fit the remaining space of the A4.

    The output format is to be PDF

    The WP-concept overwhelms me slightly, but I expect something like this:

      1. Generate/load a report template with a header and footer
      2. For each supported document/data
      2a. If not tiff, convert to tiff
      2b. Scale to 80% and add image to report template, one image per page.
      3. When done, insert a TOC at first page.
      4. Convert to PDF (using TWPDFExport I guess)


    Currently we're using Delphi 2009, with WPTools 6 premium and wPDF 3 Plus.

    Can anyone please help me get started? Which components am I supposed to start with? Is there an easy way to access the image of a page, in order to downscale it? Should we upgrade WPTools? Demos?

    • Offizieller Beitrag

    Hi,

    WPTools can be used to create PNGs from single pages. You can use a TBitmap and draw the page to:

    WPRichText1.PrintPageOnCanvas(bit.Canvas,
    Rect(0, 0, w, h), pagno, [ppmPaintTransparent, // ppmPrintFrame,
    ppmStretchWidth, ppmStretchHeight, ppmIgnoreSelection, ppmUseEvents], 0);


    you can use a graphic library to create PNGs from the images in the multi page TIFF.

    And insert altogether into a report in WPTools.

    Then you can export to PDF.

    Alternative would be to convert TIFF to PDF, convert RTF to PDF and use WPViewPDF PLUS to merge all PDFs to a new PDF. The problem is the scaling and the TOC in this approach.

    Upgrading WPTools 6 to 7 is always a good idea.