• Hi,

    My client has been using a text processor built around Wptools 5 for a number of months. This text processor allows him to generate documents using a system of templates and fields being popukated from a database. Everything works fine.

    I recently implemented Wpdf and it works a treat in combination with Wptools 5. Long story to explain the background. in all his templates (or base documents) he has added his logo and would like me to hide the logo when he prints the document, but keep it when a pdf is generated.

    How would you go about doing this ? (I would like to add that the logo has been insered as an image, it is not a field or anything.

    • Offizieller Beitrag

    Hi,

    did You see PrintParameter.PrintOptions?

    TWPPrintOptions = set of (
    wpIgnoreBorders, wpIgnoreShading, wpIgnoreText, wpIgnoreGraphics,
    wpUsePrintPageNumber, wpDoNotChangePrinterDefaults, wpDontPrintWatermark,
    wpDontReadPapernamesFromPrinter,
    wpAlwaysHideFieldmarkers, //hide field markers in PrintDialog
    wpDontAllowSelectionPrinting, // Don't allow the printing of the selected text in Print Dialog
    wpCompareWidthHeightToDetectLandscape,
    wpAllColorsAreBlack
    );

    If you use the flag wpIgnoreGraphics the images would not be printed.

    Regards,
    Julian

  • Julian, thanks for the answer. but my problem cannot be solved this way as there may (will) be other graphics (pictures for example) that still need to be printed.

    It is only that single picture (the logo) which they may or may not want to print.

    Didier

    • Offizieller Beitrag

    Hi,

    You can hide objects by using the flag 'wpOnlyPositionFrame' in the mode property.

    You can also hide objects by using the event OnTextObjectPaint

    Code
    procedure TWPTBXForm.WPRichText1TextObjectPaint(Sender: TObject;
      pobj: TWPTextObj; toCanvas: TCanvas; XRes, YRes, X, Y, W, H,
      BASE: Integer; PageRef: TWPVirtPage; Modes: TWPTextObjectPaintModes;
      const CanvasExtraAttr: TWPPaintExtraParams;
      var ContinueMode: TWPTextObjectPaintResult);
    begin
      ContinueMode := [];
    end;

    Julian