WPCubed Product Support

Hiding an image

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.

#1 ♥ 0
4.8k Views 2 users read 2 min
support

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

#2 ♥ 0

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

#3 ♥ 0

UP,

Julian, I really need an idea; sorry to be a pain, but this is blocking completely my release.

#4 ♥ 0
support

Hi,

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

You can also hide objects by using the event OnTextObjectPaint

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

#5 ♥ 0

Julian,

I am sorry I did not answer but I have been real busy with the go live.

thanks for your help

Didier

#6 ♥ 0
This category is archived. No new posts are possible.