|
|
// This sample code creates a TWPRichText and a TWPDFExport
// on the fly and uses both to create a PDF file:
uses WPDefs, WPPrint, WpWinCtr, WPRich, WPPDFR1, WPPDFWP
procedure RTF2PDF( RTFname, PDFname : string);
var
WPRichText: TWPRichText;
WPPDFExport: TWPPDFExport;
begin
WPRichText:= TWPRichText.CreateParented(Application.Handle);;
WPPDFExport:= TWPPDFExport.Create(nil);
WPPDFExport.Source := WPRichText;
try
WPRichText.LoadFromFile( RTFname );
WPPDFExport.FileName := PDFname;
WPPDFExport.Print;
finally
WPRichText.Free;
WPPDFExport.Free;
end;
end;
|