Hello,
I would like to load a document into a WPRichText and save it into PDF. It is working if I'm exporting a WPRichText to PDF with the visual component, but I would like to do it with no visual component so that the opening of the document is hidden.
The code below gives me a ERangeError. Do I need to do something with the WPRichText before exporting to PDF ?
Code
wp_richtext := TWPRichText.Create(Application);
{ Here I have my code code to load the document into the WPRichText }
WPPDFExport := TWPPDFExport.Create(nil);
WPPDFExport.DLLName:= exec_path + 'wPDF300W.dll';
WPPDFExport.Source := wp_richtext;
try
WPPDFExport.Filename := MyFileName;
WPPDFExport.Print; // <-- ERangeError
result := true;
finally
WPPDFExport.Free;
end;
end;
wp_richtext.Free;
Alles anzeigen