Posts by wpsupport
-
-
Well, this is a word processor. It already has a lot of capabilities.
CodeI want to draw a visual marker around the content which can be edited, like an edit box or an input field. The visual marker should only wrap the editable content, not the whole cell.
I don't see a way this is possible. You can assign a property to the "editable" text, similar to the edit fields and the hyperlinks. But having a rectangle around some part of the text inside a paragraph is not possible.
-
This is some code I found here
Code
Display Moreprocedure TForm2.WPRichText2CustomLinePaintAfter(Sender: TObject; RTFEngine: TWPRTFEngineBasis; param: TWPVirtPagePaintParam; EndOfPageRun: Boolean); var r: TRect; par: TParagraph; begin if EndOfPageRun then // at last ... begin r := Param.UnionRect; Param.Canvas.Brush.Style := bsClear; Param.Canvas.Pen.Width := Param.Page.XPixelsPerInch div 30; Param.Canvas.Pen.Color := clBlack; InflateRect(r, Param.Page.XPixelsPerInch div 30, Param.Page.XPixelsPerInch div 30); // We need to start on next page with a box! if (Param.Par.NextPar=nil) or (Param.Par.NextPar.ParagraphType=wpIsTable) then HasOpenBox := TRUE; Param.Canvas.Rectangle(r.Left, r.Top, r.Right, r.Bottom); end else if Param.Tag = 0 then // check each par only once! begin // This is need to for dynamic boxes to span multiple pages! if Param.PageNo=0 then HasOpenBox := FALSE; Param.Tag := 1; par := Param.Par; // Am Anfang der Seite oder am Anfang des Textbodys // NICHT in Tabelle! if HasOpenBox or (par.ParentTable = nil) and (par.ParagraphType=wpIsSTDPar) then begin while (par <> nil) and not par.IsTable do begin Param.UseUntilIncludingPar := par; par := par.NextPar; end; Param.Tag := 2; // we need to know that this is a dynamic box if par <> nil then Param.CallAgainToClose := TRUE; end; end; end; procedure TForm2.WPRichText2CustomLinePaintBefore(Sender: TObject; RTFEngine: TWPRTFEngineBasis; param: TWPVirtPagePaintParam; EndOfPageRun: Boolean); begin if Flash.Checked and (Param.Par = flashpar) then begin Param.Canvas.Brush.Style := bsSolid; Param.Canvas.Brush.Color := clYellow; Param.Canvas.FillRect(Param.Rect); end; end;
-
What is the pupose to do this?
QuoteI want the rectangle to be aligned with the table cell.
If you want to render custom graphics around lines or paragraphs there are some events to do this the best way.
Check out OnCustomLinePaintBefore and OnCustomLinePaintAfter - that makes it possible to draw under and over the text. You can use it to change the rendering depending on the contents of the text.
I do not recommend to access the internal datastructures like in the code mentioned above. GetXYPositionAtRTFT is there to show overlay windows, not to paint.
This example highlights the current table row:
procedure TForm1.WPRichText1CustomLinePaintBefore(
Sender: TObject;
RTFEngine: TWPRTFEngineBasis; param: TWPVirtPagePaintParam;
EndOfPageRun: Boolean);
begin
if (WPRichText1.TableRow<>nil) and WPRichText1.TableRow.Contains(Param.Par) then
begin
Param.Canvas.Brush.Style := bsSolid;
Param.Canvas.Brush.Color := $eaefea;
Param.Canvas.FillRect(Param.Rect);
end;
end; -
You have access to the relevant source code in WPCtrMemo.pas - I recommend to check that out.
There are multiple ways to change the clipboard behavior using the ClipboardOptions, for example to only allo plain text.
You can use the event BeforePaste to preprocess the loaded text before it is being inserted. -
I assume the problem is caused by the text not to be formatted.
1. I recommend to create a TWPCustomRTFEdit class instead of TWPRichText.
2. Instead of Create(nil) call CreateDynamic. The latter makes sure the control works without a parent form.
3. Call ReformatAll twice before Print, not before and not Refresh.
Use the component in a DLL is a problem? I neep only the PDF convertion then I set visible = False;
That can be a problem since this also potentially violates the license.
-
Yes, CustomObjects can be used for this
-
*** WPTools 9.4.0.1 - 26.4.2025
+ WPReporter AddGroup now knows the mode wpatWrapSelection to wrap text to be inside of a group
+ OptIgnoreEmbeddedImageData for HTML and WPT format reader
+ overlay text painting for images available trhough PaintObject event
* improved performance in tool bar creation -
*** WPTools 9.4.0.0 - 27.3.2025 *** INITIAL RELEASE 9.4
1) Much enhanced SVG rendering engine (Only for Delphi 10.1 and later!)
+ SVG Rendering in TWPToolsBar
+ SVG Image object to implement GUI
+ SVG image list style (select glyphs by column/row)
+ SVGColorMap list to update selected colors in the SVG to match theme or state of a control
+ shared SVG resources for different buttons2) improved class TWPSvgImage (Only for Delphi 10.1 and later!)
Displays a whole SVG or just an element. Show shape in background. Supports dynamic changes of SVG
rendering color on mouse events, not only globally, but also based on a row/col area. (Implement touch controls)3) new class TWPSvgButton (Only for Delphi 10.1 and later!)
Like a TButton but also with a glyph loaded from SVG.4) new class TWPSvgStorage (Only for Delphi 10.1 and later!)
Stores the SVG data for one or more buttons or images.5) Improved formatting routine "WPRTEFormatH"
This formatter can be customized much easier to handle each paragraph, table, row and cell in a certain way.
It triggers events during formatting, i.e. to manipulate the rectangle where text is placed.
The formatter makes special formatting logic possible. Please ask us for our offer to do custom enhancements on
this versatile formatter for reasonable costs.6) Improved TWPToolbar
Better support for Themes. Optionally use SVG rendering.
Optionally rendered transparently.7) Improved HTML support
+ optional read <title>...</title>
+ option "-useCR" - create page breaks when \r\n is read (for lazy encoded HTML)
+ optionally suppress for empty paragraphs
+ optionally suppress style parameters for UL lists
+ suppress WPReporter bands
+ write a special class=... for paragraphs which are empty (const WPHTML_EmptyPInHTML)
+ trigger event BeforeSaveTextObject before a text objects is saved.
+ trigger event AfterSaveTextObject after a text object was saved
+ customize the tags written for text objects through collection WPTextObjectClasses
+ support "class" extra property for TextObjects
+ write mail merge tags using the tag defined in constant WPHTML_MERGEFIELD_TAG
+ read <pre> and create a text object around this section (optionally: $DEFINE HTML_HTML_PRECODEOBJ}
* some improvements: save image width/height8) improvement in RTF-Engine
- Alignment of bullet paragraph in a table cell
* Undo in Tables
* several additions to API
* handling of Inc/Dec Indent with bulleted paragraphs -
Last Changes in WPTools 9.3 (Service time: 23.6.2022 - 1.3.2025)
*** WPTools 9.3.9.3' - 1.3.2025 ***
* changed unit WPUtil.PAS. With certain Delphi Compilers the interfaces used in the code caused Problems.
We are now using an interface object to aviod this problems.
*** WPTools 9.3.9.3 - 25.2.2025 ***
- improve display of style name in style Dialog for styles with numbering
+ new flag wpAlwaysIgnoreAllPadding in WPFormatOptionsEx2 to reduce table cell size
* some fixes in spellcheck (included with WPTools Premium)*** WPTools 9.3.9.2 - 8.12.2024 ***
+ new global variable in unit WPIOReadRTF: wpRTFReadLimitParDepth
Assign 10 or a higher value to make it possible to load documents with too deep table nesting which would
break the editor otherwise.
- fix Display of footnote number
- In BeforePasteImage ist is possible FreeAndNil the inserted object
- handle case when an Image has width or heigh = 0
- new load Option loCallClearSelectionBeforInsert
* some fixes and API enhancements in unit WPXMLInt....
-
Just delete the "WinAPI."
But this should be inside of a $IFDEF DELPHIXE and DELPHIXE should not be defined for Delphi 7. -
Sorry, I do not know such a product. The wPDF engine converts EMF data.
-
The upcoming WPTools 9.4 will have the ability to paint the icons completely as vectors. The vector is loaded from one SVG file which uses SVG glyphs arranged in rows and columns. This makes it eays to change the complete design of a program easily. Forthermore during paint it is possible to replace certain colors with different colors, not only to adapt for dark/light theme but also to show hover evects.
Do get more out of the prowerful SVG engine there will a new button class TWPSvgButton which is similar to the good old TBitBtn but displays a SVG glyph. The buttons can get their SVG data from a TSVGStorage object which is shared for different elements. They can then just display a part of that data, indentified by row/column.
Comparision
Display in WPTools 9.3
The same program compiled with WPTools 9.4
When you work with themes you can now also make the toolbar and buttons transparent. This makes the UI much more attractive.
WPTools 9.4 is expected soon
-
I cannot reproduce this. Is this happening with the latest WPTools 9.3.2?
(BTW - 9.3.3 was posted a minute ago) -
Sorry, I cannot reproduce. You may send me your text in WPT format so I can load it-
-
It may load the wrong DLL - please check which WPViewPDF Version is in the EXE Directory. It may be a different one to the one you depoly.
-
You can use the old RES file
-
WPTools 9.3 optionally uses even SVG based tool bar icons which are rendered on the fly to a bitmap with the right resolution.
If you want to update the icons to your liking you can use the resource editor and edit Wptbresnew.res or link in the old WPTBRES.RES
-
WPXOrder ist eine Sammlung von Delphi-Units zur Erstellung und Auswertung von X-Factur (ZUGFeRD) XML-Daten.
Sie wurde erstellt, um Rechnungs Daten zu laden, zu verarbeiten und zu speichern. Es beinhaltet noch nicht den E-Invoice-Standard und ist darauf ausgerichtet, XML-Daten zu erstellen, die in PDF-Rechnungen eingebettet werden. Um solche Rechnungen zu erstellen, können Sie die praktische PDF-Erstellungs-VCL wPDF verwenden. Um solche Rechnungen zu lesen, können Sie WPViewPDF PLUS verwenden, das nicht nur X-Factur Daten extrahieren, sondern auch anhängen kann.
Bitte schauen Sie sich den Quellcode auf unserer WPXOrder GitHub Seite an.
Zweck und Lizenzierung
WPXOrder wurde entwickelt, um XML-Anhänge für Rechnungen zu erstellen, die als PDFs verteilt werden. Es wurde in Delphi 10.1 entwickelt und funktioniert am besten mit unseren Produkten wPDF oder WPViewPDF PLUS. Es kann auch verwendet werden, um Rechnungs XML-Daten zu lesen und auf alle Eigenschaften einfach zuzugreifen. Es kann auch zur Überprüfung der Berechnung (Gesamtsummen) verwendet werden - bitte beachten Sie jedoch, dass wir nicht garantieren können, dass solche Berechnungen in jedem Fall korrekt funktionieren.
Durch die Art der Implementierung werden folgende Fehler bei der Erstellung von XML Daten vermieden:
1) Schreibfehler der XML Tags
2) Eigenschaften in falschem Eltern XML Element
3) Falsche Reihenfolge der Elemente (Wichtig für die Validierung)
Desweitern kann man Werte in speziellen Typen, wie TDateTime oder float values zuweisen.
Mit der mitgelieferten EXE können Sie die Beispiel-PDFs öffnen und die internen Berechnungen mit den in den PDFs hinterlegten Zahlen vergleichen.Mit nur einem Klick können Sie Delphi-Code erstellen, der die Daten so erzeugt, wie sie in die Rechnung geladen werden. Dies erleichtert das Verständnis Format besser zu verstehen und Rechnungen zu erzeugen, die erfolgreich validiert werden können.
WPXOrder - create and read X-Factur/ZUGFeRD XML -
Nun ist das Modul fertig. Hier wird die neue Bibliothek beschrieben: