Beiträge von wpsupport

    This is a simple example for Stamp Metafile. Metafiles should always be EMF, not WMF.

    This is the sample code to convert a PDF file into a watermark

    The command COMPDF_LoadFileAsWatermark is used to load a PDF file and convert a certain page into a watermark. The ID of the new watermark is retuned. If the PDF file was already loaded, it will be reused. So it is possible to subsequently use different pages from the same PDF file.

    The command COMPDF_ApplyWatermark is used to apply the watermark with the given id to certain pdf pages. The string parameter of this command is used to select the destination pages. It is possible to select "all", "odd" or "even" pages. Alternatively a range can be specified, such as "1-3,5,7,9-1000".

    To add a positioning mode add it after ";". Positioning modes are 0=over page, 256=under page (default)

    Instead of page list also the text odd and even is allowed. Returns the number of modified pages

    You cannot really stamp a metafile created with getmetafile and stamp it. The metafile stamping pnly supports very small, uncomplicated metafiles,i.e display COPY or something like this

    You can load a pdf and another and use pages from the first as watermark. This should be a better approach

    The finder works well, there is also an extensive find dialog which may be a good example on how to use it.

    However: My aim is to make a searchform that can find and select every instances of the searchtext - one at a time. But how to do this?

    This cannot really work since it is not possible to have a selection for several words on different paragraphs.

    You can check out the unit

    WPSyntaxHighlight

    It may be of use.

    This code is problematic:

    1. SelectText;
    2. https://www.wpcubed.com/forum/board/in…eLine_47_f726f4 FWp.ScrollToPosition(FWp.CPPosition, 0, 10);

    You should also set the CPPosition to Finder.FoundPostion.

    Funktionen die Graphiken einfügen:

    function InsertGraphic(filename: string;

    InsertLink: Boolean = FALSE; ObjectModes: TWPTextObjModes = []):TWPObject;

    function InsertGraphicDialog(filter: string = ''; InsertLink: Boolean = FALSE;

    ObjectModes: TWPTextObjModes = []; path : string = ''): TWPObject;

    Beide Funktionen setzen bei Erfolg noch WPRichText.InsertedObj für den einfachen Zugriff auf das TWPTextObj.

    Aus dem Kontext schliesse ich, Sie wollen das gerade eingefügte Objekt selektieren, sodass es der User es gleich mit der Maus verschieben kann.

    Das geht so:

    PS.: Nach einem Button Klick muss man den Fokus erst wieder an das TWPRichText geben, daher das SetFocus.

    Zuerst einmal wird der event OnUndoStateChanged ausgelöst.

    Dort kann man

    (Memo.RTFData.UndoStack.LastUndoObj as TWPToolsUndoObject).Kind abfragen welches diese Werte annehmen kann:

    wputNone, wputAny, wputInput, wputDeleteText,

    wputChangeAttributes, wputChangeIndent, wputChangeSpacing,

    wputChangeAlignment, wputChangeTabs, wputChangeBorder, wputDeleteSelection,

    wputDragAndDrop, wputPaste, wputInsertObject, wputChangeObject,

    wputDeleteObject, wputChangeTable, wputChangeStyleSheet, wputRedo,

    wputMargin, wputReplace

    For RTL text this export method is not changeable, otherwise you can select another font mode. The best support for unicode text, the CIDFont mode provides.

    But in your EMF file something is weird. I insert it into Word and tried to print to Destiller - that crashed. I opened the EMF in a graphic program and only saw random characters.

    When you say, you can select the text in the PDF file created by another tool, did you try copy and paste? After pasting did the correct text show up?

    Inside wPDF I do not get any usable character information from emftext.emf. The text is printed using index values which point to glyphs of the font being used. Unfortunately I know now way to convert those index values back into text.

    Please, before any programmatic update in the DBWPRichText call DBWPRichText1.Changing.

    In case of the load button in the toolbar you can trap the user click in the event OnToolbarIconSelection of the TWPRichText (or TDBWPRichText) and execute Changing there.

    Please see the default implementation in WPCtrRich.pas to undrestand how this handler works.

    *** WPTools 8.10 - 3.12.2018 ***

    + support for Delphi 10.3 Rio

    - fix in unit WPTabDlg1

    * when a style is applied using SetActiveStyleName the attributes are not cleared anymore

    unless wpClearAttrOnStyleChange is used in

    - fix image loading in DocX reader - load image name from imagedata and imageData

    - fix in DocX writer: write "imagedata" insetad of "imageData"

    - fix writing of NSTY= in paragraph styles in WPT format