With Delphi 2009, WPTools 6.05.7 and wPDF 3.55
If I save a document in WPRichText component that contains merged fields and then create a pdf file using the code below, the merge field markers are displayed in the pdf document. Is there a mechanism to prevent the display of these markers?
tempRTFPathAndName := tempFilePath + adsTablePtLetters.FieldByName('FileName').AsString;
tempPDFPathAndName := tempRTFPathAndName;
tempPDFPathAndName := Copy(tempPDFPathAndName, 1, Length(tempPDFPathAndName) - 3);
tempPDFPathAndName := tempPDFPathAndName + 'pdf';
tempRTFEdit := TWPCustomRTFEdit.CreateDynamic;
tempWPPDFExport:= TWPPDFExport.Create(nil);
try
begin
with tempWPPDFExport do
begin
Filename := tempPDFPathAndName;
Source := tempRTFEdit;
FontMode := wpUseTrueTypeFonts;
CidFontMode := wpCIDOff;
PDFAMode := wpdfaOff;
CompressStreamMethod := wpCompressNone;
AutoLaunch := False; // Do not show when completed
end;
tempRTFEdit.LoadFromFile(tempRTFPathAndName,true,'AUTO');
tempRTFEdit.ReformatAll(true,false);
tempWPPDFExport.Print;
end
except
begin
MessageDlg('A pdf file was unable to be created from the ' + tempRTFPathAndName + ' file.',
mtError, [mbOK], 0);
tempContinue := False;
end;
if tempWPPDFExport.Printing then
begin
tempWPPDFExport.EndDoc;
end;
tempWPPDFExport.Free;
tempRTFEdit.Free;
Screen.Cursor := crDefault;
end;