c# - Is it possible to get the bottom pixel in iTextSharp -
I am trying to design a footer, but the footer should be full on every single page.
Is there a function to capture the bottom of the page? After that I can reduce some pixels and add my footer to it.
int bottom = document.GetBottom (): ct.SetSimpleColumn (20, 20, 0, below-20);
something with that line? Although only the pseudo code is.
iTextSharp provides document documentation.
PdfContentByte cb = wri.DirectContent; Column reader CT = new column text (CB); The phrase myText = new phrase ("footer here", fontfacture.Get Font ("Ariel bold", 10.0f, font .bind, base collar.black)); Float text width = myText.Font.GetCalculatedBaseFont (wrong) .GetWidthPoint ("AASCTT • 1444I Street, NW • 700 Suite • Washington • DC • 20005 • (202) 449.1099 • info@aasect.org", 10.0f); Ct.SetSimpleColumn ((Doctor / Write / 2) - (TextView / 2), 1, (Doctor Right / 2) + (TextView / 2), Doctor Batam); Ct.AddText (myText); Ct.Go ();
This 'stage' creates myText and then calculates the base font to gain access to GETWidthPoint to measure the size of the text. By calculating the center of the document and calculating half of the width, the most represents the x coordinate and adding half the width of the text repeats the reverse for the highest x coordinate correct
I hope It helps a person, I have got many different ways of making a footer and none of them works, hopefully it meets someone's needs.
Comments
Post a Comment