Hier wird die Erstellung eines combo feldes beschrieben.
Ansonsten hier ein kurzes Besipiel:
Hier wird die Erstellung eines combo feldes beschrieben.
Ansonsten hier ein kurzes Besipiel:
COMPDF_LoadEStream kann in WPViewPDF V4 nicht mit dem WorkBench verwendet werden. Allerdings wäre die Verwendung contra produktiv, wenn man mit sehr grossen Dateien arbeitet denn hier wird die PDF immer gleich komplett geladen.
Um das gerade selektierte zu markieren reicht es aus den Pointer auf das selektierte mit dem zu zeichnenden Textbox zu vergleichen. Mann muss dafür nicht die Liste durchlaufen. Ich hatte in 2017 das entsprechende Event eingebaut:
procedure TWPPremTest.WPRichText1BeforePaintLayer(Sender: TObject;
Editor: TWPRTFEnginePaint; RTFData: TWPRTFDataBlock; Canvas: TCanvas;
R: TRect; InEditor, IsEditing: Boolean);
begin
if InEditor and IsEditing and (RTFData.Kind = wpIsOwnerSelected) then
begin
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := $eaefea;
InflateRect(r,-5,-5);
Canvas.FillRect( r );
end;
end;
Zitatist list.count dann aber 0 groß!
Das liegt daran, dass Sie hier kein Objekt des Types wpobjTextObject sonder eine TextBox erstellen. TextBoxen haben wie Bilder den Typ wpobjImage.
Derzeit ist es so, dass die PDF(s) nach und nach geladen werden allerdings bleiben die Objekt dann im Speicher. Daher kann es bei extrem grossen Eingabe Daten zu hohem Speicherverbrauch kommen.
Für eine Liste der COMPDF_ siehe am besten die Datei WPDF_ViewCommands.pas öffnen
Usually the event TWPRichText.OnRequestHTTPImage is used to load an image which is referenced by a name or id.
That event is also available in the TWPRTFDataCollection which is accessible through Painter.RTFData. (I renamed "RTF" to "Painter")
To use the event you need to create an event handler like this:
Procedure TForm.DoLoadImage(
RTFData: TWPRTFDataCollectionBase;
Reader: TWPCustomTextReader;
const LoadPath, url: string; TextObject: TWPTextObj; var Ok: Boolean) ;
And assign it to Hint.Painter.OnRequestHTTPImage in code.
How do you reference the linked images. During the assign procedure it cannot tell which path to use. I would rather use embedded images in this case.
Unfortunately You cannot use "Description" since that will always be printed by the default implementation and also "Title" cannot be used since both are always aligned in the center of the window.
A TWPRichText would cause too much overhead, this can be done easily with the TWPPaintEngine. But it is necessary to override the TBalloonHint.
The code is also a good example how to use this non-visual class TWPPaintEngine.
TWPRTFBalloonHint = class(TBalloonHint)
private
FRTFText : TWPPaintEngine;
FWidth : Integer;
FHeight, FOffRTF : Integer;
procedure SetText(const Value: string);
protected
procedure PaintHint(HintWindow: TCustomHintWindow); override;
procedure SetHintSize(HintWindow: TCustomHintWindow); override;
public
constructor Create(aOwner : TComponent);
destructor Destroy; override;
property Painter: TWPPaintEngine read FRTFText;
property Text : string write SetText;
property Width : Integer read FWidth write FWidth;
property Height : Integer read FHeight;
end;
//----
constructor TWPRTFBalloonHint.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
FRTFText := TWPPaintEngine.Create(Self);
FRTFText.MakeRTFData;
FRTFText.RTFData.FormatOptions := [wpfAlwaysFormatWithScreenRes];
FWidth := 200;
end;
destructor TWPRTFBalloonHint.Destroy;
begin
FRTFText.Free;
inherited;
end;
type TCustomHintWindowHelper = class(TCustomHintWindow)
public property Canvas; end;
procedure TWPRTFBalloonHint.PaintHint(HintWindow: TCustomHintWindow);
begin
inherited;
FRTFText.Draw(TCustomHintWindowHelper(HintWindow).Canvas,
2, FOffRTF, HintWindow.Height,
WPScreenPixelsPerInch,WPScreenPixelsPerInch,0);
end;
procedure TWPRTFBalloonHint.SetHintSize(HintWindow: TCustomHintWindow);
begin
FOffRTF := cBalloonStemHeight+2;
FRTFText.PageSizes.Clear;
FRTFText.PageSizes.Add(MulDiv(FWidth-4,1440,WPScreenPixelsPerInch) ,100000);
FRTFText.Reformat;
FHeight := FOffRTF + FRTFText.Memo.TextHeight(WPScreenPixelsPerInch);
HintWindow.Width := FWidth;
HintWindow.Height := FHeight;
end;
procedure TWPRTFBalloonHint.SetText(const Value: string);
begin
FRTFText.MakeRTFData;
FRTFText.RTFData.SetANSIString(Value);
end;
Alles anzeigen
Usage:
in Form.OnCreate
aHint := TWPRTFBalloonHint.Create(Self);
when you need it:
aHint .Text := '<html><div style="text-align:center">Hello <b>World</b><br>Second Line</div></html>';
aHint .ShowHint(Mouse.CursorPos);
(The TWPRTFBalloonHint will officially be part of the next release of WPTools 9.1.)
Für sowas könnte man einfach eine leer Seite einfügen und über DrawWatermark das Bild aus einer externen Quelle einblenden.
Es ist nicht möglich ein PDF in ein RTF einzufügen oder ein RTF in ein PDF.
Was geht is mehrere PDF Dateien in WPViewPDF plus aneinander zu hängen und dann die Seiten neu zu ordnen und auch Seiten zu löschen.
Natürlich kann man Bilder (PNG) aus WPViewPDF an beliebigen Stellen in einen Text einfügen - Sektionen braucht man dafür nicht.
WPTools 6 ist aber überholt.
PDF/a also means future compatibility and the possibility to edit a PDF file. Font subsetting works here contradictory. However the validator programs used to accept the file.
Basically you just add the bitmap data. I assume something is done between the printing and the PDF export with wPDF so the data written by WPWriteComment does not get through. This appears to be connected to the concrete project.
Thank You, It will be fixed.
If both the TWPRichText use the same TWPRTFProps object you can simply move the last vSlavePar which is not in "Master" and append it to Master.
Try:
vMasterPar.AppendTree(vSlavePar.UnlinkParagraphList).
The code originally was intended to be inside the loop to skip spaces, this is why the lines are duplicated.
To solve your problem I would create an ID for each paragraph when it is appended. So you can skip the paragraphs which have been appended before.
As ID you could use the name property of a paragraph or par.ASet(WPAT_USER, id) (which is not saved to RTF, btw).
Alternatively you could also use hidden text.
I am sorry, I don't know anymore what the problem is. If you found the fix above what is the problem?
WPTools 9.1 would be the current version.
fileextension is a property of the image object. If you load the date from stream it must be set.
Ja:
*** WPTools 9.1.020 - 2.3.2020 ***
...
* improvements in colspan handling
Es wird also MergeText nach dem Einfügen des Textes aufgerufen und dabei gehen die Attribute verloren, nicht wegen SaveToString!
Achten Sie bitte darauf, dass die Einfügepunkte << >> das text Attribut besitzen, welches auch der enthaltene Text haben soll.
Das ist immer wichtig, ob die Felder im header, footer, text box oder im body sind.
Der Text innerhalb von << >> ist nicht das Feld, sondern der Feldinhalt. Dieser Text ist optional und kann ersetzt werden, er kann auch fehlen.
Man kann die Attribute des Textes aber so auslesen (--> Mail Merge):
Contents.MergeAttr.CharAttr := WPRichText1.CPCharAttr;
Yes, it is an action.
You can look for
380499 0 obj
to see how that action is defined.