ReportBuilder custom component & wPDF

  • Hi,
    I have a custom component for ReportBuilder 10 that basically works the same as a TppShape but produces a polygon (to display a blunt corner rectangle). It current implements the Printer & Screen devices - which is not enough to get wPDF to use it. I've been told by support to produce a MetaFile for it and that it would then print - but I'm having trouble finding any sort of example of this. Has anyone created a custom component for RB that renders in PDF with wPDF and would be willing to provide me some example code for programming the device?

    Thanks,
    Nick Hustak

  • Hi, yes there's been some confusion on my end but I resolved it (thanks Julian!) My issue is definitely with wPDF - I confirmed this by checked the PDF properties after generation (and making sure my test program doens't contain any other third party references)

    I was just hoping to maybe find someone that's ran into the issue and solved it already.

  • It is using the canvas with the polygon command - my component is based upon some older code from a third party component so it's possible it's not responding to something as it should. It's a fairly simple drawing component (and a complete hack job on my part - I should have done more research). I'll post some embarassing code from it shortly.

    • Offizieller Beitrag

    Polygon is supported - per se.

    What can be problematic are difficult coordinate conversion or clipping. Since PDF cannot modify a clipping region (it can not include areas which were excluded before) it is required to build a propper stack in this case.

    This is done with SaveDC/RestoreDC. So instead of appling clipping and removing it later create a stack entry with SaveDC, set clipping and when done use RestoreDC.

    Julian

  • Ok - the only issue I see right now is how to scale my units for the device. For the Printer I currently use:

    lBluntLowerRightH :=
    Trunc(ppFromMMThousandths(FBluntLowerRightH, utPrinterPixels, pprtHorizontal, LPrinter));

    Where LPrinter came from PrinterDevice.Printer

    What would I use for the PDF Device?

    Let me ask another question - I looked in the RB source code and there's a notation there about handling components that only write to the printer & screen (which is what mine is ). Normally wPDF would pick them up correctly?

    Thanks,
    Nick