scalrichview can not print the embed image.
scalrichview can not print the embed image.
I have insert a image and use SRichViewEdit1.PrintAll to print. But It is only printed text.
If the image is on the first line, It can be print. The other can not.
If the image is on the first line, It can be print. The other can not.
Send an example of this document on [email protected]
While you're at it, can you please provide a way to get the page coordinates of images so I can create a URL annotation for them in a PDF file? It works on the very first page, but after that, I cannot figure out how to get proper coordinates. There is no callback or any other way I can find that says when an image is being rendered to the printer canvas.
Thanks
-David
Thanks
-David
Use function convertRVtoSRV(p : TPoint) : TPoint;
It converts coordinates RV in coordinates SRV.
It converts coordinates RV in coordinates SRV.
Code: Select all
var
PageNo : Integer;
PageRect : TRect;
DrawItemPos: TPoint;
PosInSRV : TPoint;
....
DrawItemPos.X := DrawItemPos.X + SRV.RichViewEdit.HScrollPos;
DrawItemPos.Y := DrawItemPos.Y + SRV.RichViewEdit.VScrollPos * SRV.RichViewEdit.VSmallStep;
// Page number with PosInSRV
PageNo := SRV.getRVPageNo(DrawItemPos);
// Position on Screen
PosInSRV := SRV.convertRVtoSRV(DrawItemPos);
// Absolute position in SRV
PosInSRV.X := Round(PosInSRV.X + SRV.OffsetDocX);
PosInSRV.Y := Round(PosInSRV.Y + SRV.OffsetDocY);
// Area Page in SRV
PageRect := SRV.RectPage(PageNo);
// Position in PageNo
PosInSRV.X := PosInSRV.X - PageRect.Left;
PosInSRV.Y := PosInSRV.Y - PageRect.Top;