Generated PDF is "deleting" some chars (Wptools 3)
Hi,
as I said. I run a demo here and it does not show this symptom. I tried different data and texts, also merge fields.
YOu can go into WPPDFWP and see what strings get sent to the PDF engine.
Julian
Hi Julian !
Unhapply your code didn't fix. But i found out a strange solution for that.
For example, if my phrase is short like: "This is a test", generated pdf render "This is a tes". But my solution was to add some blank spaces at phrase ending... so my phase now is "This is a test " and i got a correct pdf now.
Very strange that! Do you wanna me to send you my rtf file to investigate that behaviour ?
Hi,
I tested it with Delphi 4, WPTools 3.12, wPDF 3 like this:
// uses WPPDFWP
procedure TForm1.ExportClick(Sender: TObject);
var ExportPDF : TWPPDFExport;
begin
ExportPDF := TWPPDFExport.Create(Self);
try
ExportPDF.FileName := 'c:\test_wptools3.pdf';
ExportPDF.AutoLaunch := true;
ExportPDF.Source := WPRichText1;
WPRichText1.ScreenResMode := rm1440;
WPRichText1.InsertPointAttr.Hidden := true;
WPRichText1.ReformatAll;
ExportPDF.Print;
finally
ExportPDF.Free;
end;
end;
(It is necessary to disable the code
*if (PTTextObj(p^.current_ptr)^.obj <> nil) and
(TWPObject(PTTextObj(p^.current_ptr)^.obj).URL <> '') then*
for example so:
// Create Link if Object has an URL
{$IFDEF WPV4}
if (PTTextObj(p^.current_ptr)^.obj <> nil) and
(TWPObject(PTTextObj(p^.current_ptr)^.obj).URL <> '') then
begin
rec.Left := MulDiv(prect^.Left, WPPDFExport.XPixelsPerInch, TWPRTFTextPaint(Sender).Header.FXPixelsPerInch);
rec.Top := MulDiv(prect^.Top, WPPDFExport.YPixelsPerInch, TWPRTFTextPaint(Sender).Header.FYPixelsPerInch);
rec.Right := rec.Left +
MulDiv(PTTextObj(p^.current_ptr)^.w, WPPDFExport.XPixelsPerInch, 1440);
rec.Bottom := rec.Top + MulDiv(PTTextObj(p^.current_ptr)^.h, WPPDFExport.YPixelsPerInch, 1440);
WPPDFExport.SetLinkArea(TWPObject(PTTextObj(p^.current_ptr)^.obj).URL, rec);
end;
{$ENDIF}
But there is no problem and no characters are missing. I tried merge fields, too.
Please try to add
WPRichText1.InsertPointAttr.Hidden := true;
WPRichText1.ReformatAll;
I assume this fixes it.
Julian
I´m using version 3 of wPDF and WPTools 3.12
To generate PDF i´m doing this:
WPTextoF.WPTexto.LoadFromFile('c:\templates\templates1.rtf');
with WPTextoF.WPTexto do
begin
WorkOnText := TWPWorkOnOptions(1);
MergeText;
WorkOnText := TWPWorkOnOptions(2);
MergeText;
WorkOnText := TWPWorkOnOptions(0);
MergeText;
end;
WPTextoF.WPTexto.PrintParameter.PrintTitle := 'Template 1';
if ExportPDF then
begin
WPTextoF.WPTexto.ScreenResMode := rm1440;
WPPDFExport:= TWPPDFExport.Create(nil);
WPPDFExport.Source := WPTextoF.WPTexto;
WPPDFExport.FileName := 'C:\TemplateGenerated.PDF';
WPPDFExport.Print;
WPPDFExport.Free;
end
else
begin
WPTextoF.WPTexto.ScreenResMode := rmNormal;
WPTextoF.WPTexto.Print;
end;
WPTextoF.WPTexto.Clear;
if you would like to examinate, i can send you my rtf file to you and the generated pdf.
Sorry,
I don't know whats happening here. I don't know which versiobn of wPDF and the interface is beeing used. I don't recall it ever happend in V3.
Julian
Hi
In my rtf file (WPTools 3.12) i have a phrase like that:
"My book is blue". So when i export the file, the phrase is rendered like:
"My book is blu". The last char is not rendered.
if i print the original rtf, the last char is there....
what is happening ?