@wpsupport:
Hi,There is the event
OnBeforePrintPage: TWPPDFPrintPageEventThat could be used to print anything before any other wptools output. Unfortunately this event is yet not been called for tghe other output. That would be possible to do though. I think about that.
T print righjt alignt I usually measure the width of the string and subtract that value from the desired end position for text out.
Julian
I guess I don't fully understand the WPDF product, but it appears I can do the Canvas.TextOut(?,?,?) and I see it show up on the PDF. My only issue is determining what calculations to use to make sure I have it in the same spot every time.
It seems that I should be able to use the width and height of the page and then subtract the proper numbers to position it at the same spot every time. But what I don't know is what calculation to use to properly position it every time. Do I take screen resolution or pixelsperinch into consideration?
What I tried to do was this:
w := MulDiv(aWPRichText.Memo._PaintPages[i].WidthTw,WPScreenPixelsPerInch,1440);
h := MulDiv(aWPRichText.Memo._PaintPages[i].HeightTw,WPScreenPixelsPerInch,1440);
if (w=0) or (h=0) then
begin
w := Round(aWPRichText.Memo.PaintPageWidth[i] / aWPRichText.Memo.CurrentZooming );
h := Round(aWPRichText.Memo.PaintPageHeight[i] / aWPRichText.Memo.CurrentZooming );
end;
xres := aWPRichText.Memo.RTFData.RTFProps.FFontXPixelsPerInch;
yres := aWPRichText.Memo.RTFData.RTFProps.FFontYPixelsPerInch;
StartPage(MulDiv(w, xres, WPScreenPixelsPerInch),
MulDiv(h, yres, WPScreenPixelsPerInch),
xres, yres, 0);
try
// Use 0 as w and h to let the function calculate the width and height
aWPRichText.Memo.PaintRTFPage(i,0,0,0,0,Canvas, [wppInPaintForwPDF] );
Self.Canvas.Font.Name := 'Arial';
Self.Canvas.Font.Size := 8;
Self.Canvas.TextOut(MulDiv(w, xres, WPScreenPixelsPerInch) - [b]Round(1.5*xres)[/b],MulDiv(h, yres, WPScreenPixelsPerInch) - [b]Round(0.5*yres)[/b],'Page 21 of 36');
finally
EndPage;
end
So it seems like I could do the above, but maybe I need a better calculation for the (BOLD) areas.
Maybe I am going about this wrong, but it just seems like this would be the way to do it.
And to be honest my test does pretty good, but for the print routine that works with Ace Reports positions it higher so I am thinking I am not using the best calculation or not taking something into consideration.