I'm new to using PDFSharp and manipulating PDF documents so please correct any of my vocabulary if needed.
I'm taking in a PDF document. I then add one line of text to the top of the document 7 pixels from the top. Sometimes on the pdf there could be information already up in this top portion so what I need to do is shrink the existing information on the PDF just a little so there is space at the top when I write my one line of text.
Here is my sample text for just placing the image in the top right corner basically one of the samples already.
Dim sharpDoc As PdfDocument = PdfReader.Open(fileName)
For i = 0 To sharpDoc.Pages.Count - 1
sharpDoc.Pages(i).Size = PdfSharp.PageSize.A4
Dim graphics = XGraphics.FromPdfPage(sharpDoc.Pages(i))
Dim xfont As New XFont("Times New Roman",
graphics.DrawString(String.Format("ProcessID: {0} Received: {1}", process.Id, Now.Date.ToString("yyyy-MM-dd")), xfont, XBrushes.Black, CInt(sharpDoc.Pages(i).Width) - 220, 10, XStringFormats.Default)
Next
I need some information on how to scale the original information on the PDF I'm working with to make sure that the line of text I put at the top doesn't cover anything up.
Thanks for the help.