Two Pilots™    Home  |  Navigation  |  Site Map  |  Products  |  Download  |  Prices  |  For Partners  |  Support

All forums · Statistics · Search ·

Two Pilots forum / For software developers / Knowing the current cursor position in page.......
Author Message
# Posted: 7 May 2008 06:53

Is there any property/field is available to know the "current" cursor position? Or to know the used area of a page?

Lets have a look at example scenario where i am adding some text and images to the pdf file.


//Some code to print the text in PDF
PDFPilotObject.PDFPAGE_SetActiveFont("Arial", false, false, false, false, 8, PDFCreatorPilot3Lib.TxFontCharset.charsetANSI_CHAR SET);
objPDFPilot.PDFPAGE_TextOut(285, 5, 0, "Page " + PDFPilotObject.PageCount.ToString());

//To know the current Y coordinate Text position
int intY_Position = PDFPilotObject.PDFPAGE_CurrentTextPositionY;

//Code to Add some Images

//Adding Logo
PDFPilotObject.AddImageFromFile("Image Location"), //ImageName
10, //X Position
30, //Y Position
148, //Width
40, //Height

intY_Position = PDFPilotObject.PDFPAGE_CurrentTextPositionY;

in above example, when using intY_Position after printing text, it returns the current cursor location, but when I tried to use it after adding image, it returns 0.
So in that case, is there any method or property available to know the current position or to know the used area of the current page???

Vitaliy Shibaev
# Posted: 8 May 2008 01:10

Hi Shravan,

(duplicate same answer in other topic)
Thank you for your letter!
Interesting trouble, I don't think about such inconvenience. In pdf there are different page modes and coordinate spaces (graphics, text, images e.t.c.) and current text position make sense only in text mode. These details as hidden as possible, but in this place it is unfortunately opaque for user (after switching in the image mode text parameters reset) I think we improve this place in the next release. And now I recommend you to divide work with text, graphics and images.

Best regards,
Vitaliy Shibaev
Two Pilots



Powered by miniBB 2.0 RC7 © 2001-2004 Page creation time (sec.): 0.013


Page top