I'd like to use wPDF to export from a TRichView - how can I do that? Can anyone give me some example source code?
How to export from TRichView?
-
-
- Offizieller Beitrag
If the RichView can paint a page on a canvas than I suggest to use this methond in a loop such as
PDF.BeginDoc;
try
for n:=0 to richview.PageCount-1 do
if wPDF.StartPage( ... ) // PageSize
then
begin
richview.DrawPage(N,wPDF.Canvas, ... );
wPDF.EndPage;
end;
finally
PDF.EndDoc;
end;The above is only a guess - it should work so or alike. But maybe Sergey has a already demo which does it.
About hyperlinks and bookmarks - the next wPDF release will includes some procedures which let you "paint" hyperlinks - this will make it possible to create hyperlinks in the drawing code using the coordinates used by the drawing routine (whatever the coordinate system is at that moment).
But I suggest to upgrade to version 2.x - the upgrade is not expensive and you will get a completely revised PDF engine which is accurate and fast and supports a lot more features than version 1.Julian Ziersch
-
- Offizieller Beitrag
This code can be used for a TSRVRichView.
Please note that you can change the property CanvasReference to refPrinter.
Code
Alles anzeigenWPPDFPrinter1.BeginDoc; try for I := PageF to PageT do begin WPPDFPrinter1.StartPage( Round(RichView1.PageProperty.PageWidth), Round(RichView1.PageProperty.PageHeight), Res, Res, 0); RichView1.DrawPage(I, Round(RichView1.PageProperty.PageWidth), Round(RichView1.PageProperty.PageHeight), 0, 0, WPPDFPrinter1.Canvas, False, False, False); pdf.EndPage; end; finally WPPDFPrinter1.EndDoc; end;