Hi,
I am using PDFDocument to create an information page.
I write on the page with g.DrawText(MyString, 10, i) incrementing the lines (i) by 20 pixels. I have two questions :
1- How to center a line (title) on the page?
2- How to know that we have reached the end of the page to make a g.NextPage command?
Thanks.
Hi @LEROY_Daniel,
-
You can center the string in the page using, for example:
g.DrawText( myString, g.Width/2 - g.TextWidth(myString), i)
-
Because you know the increment and the document page height, you can test it against
PDFDocument.PageHeight
. When it is equal or higher, callg.NextPage
Must add ( xxx, - g.TextWidth(myString) /2, i)
Thanks