


StampedPdf.FileContent = common.MStreamToByteArray(outStream) StampedPdf.FileName = (".pdf", "_stamped.pdf") Stamp.Rotation = pdfStampBox.StampRotation IOffset = iOffset + iTextHeight + stampLine.YOffset Stamp.SetOrigin(StampX + (pdfStampBox.StampWidth - iTextWidth) / 2, (iPageHeight - iOffset)) ITextWidth = ft.TextWidth iTextHeight = ft.TextHeight
PDFKIT FIX TEXT TO WIDTH PDF
Set stamp information and apply to PDF document New (stampLine.FontColorRed, stampLine.FontColorGreen, stampLine.FontColorBlue), For each line of the stamp as defined in the ini fileįoreach (PDFStampLine stampLine in pdfStampBox.StampLineList)Ī ft = new FormattedText(stampLine.Text, StampY = iPageHeight - (pdfStampBox.StampHeight + pdfStampBox.StampTop) StampX = iPageWidth - (pdfStampBox.StampWidth + pdfStampBox.StampRight) Get height, width and rotation of the current pageįloat iPageHeight = 0 float iPageWidth = 0 int iRotation = 0 įloat StampX = 0 float StampY = 0 float iOffset = 0 PdfFileInfo fileInfo = new PdfFileInfo(inStream) Ī stamper = new PdfFileStamp(inStream, outStream) įloat iTextWidth = 0 float iTextHeight = 0 MemoryStream outStream = new MemoryStream() MemoryStream inStream = common.ByteArrayToMStream(pdfDocument.FileContent) PDFDocument stampedPdf = new PDFDocument() SaveToFile(pdfDocument.FileContent, PDFDocument StampDocument(PDFDocument pdfDocument, PDFStampBox pdfStampBox) PdfDocument = pdfServices.StampDocument(pdfDocument, pdfStampBox) PdfStampBox.StampLineList = pdfStampLine4 PdfStampLine4.Text = "FL OFFICE OF INSURANCE REGULATION" PdfStampBox.StampLineList = pdfStampLine3 Ĭ pdfStampLine4 = new () PdfStampBox.StampLineList = pdfStampLine2 Ĭ pdfStampLine3 = new () PdfStampLine2.Text = "Date Received: Date Of Action:" PdfStampBox.StampLineList = pdfStampLine1 Ĭ pdfStampLine2 = new () PdfStampBox.StampLineList = new Ĭ pdfStampLine1 = new () PdfDocument.FileContent = pdfStampBox = new () text, color, font, etc) is loaded in a list and it iterated thru for each page and does not change.Ĭ pdfServices = new () Ĭ pdfDocument = new () As I am interating thru the page count when I go from a landscape page to a portrait, it appears the stamp text is getting added but it's not visible.I can highlight the stamp text and copy and paste to a text document to verify it's there but its just not visible in the PDF document. Some documents contain a mix of portrait and landscape pages, therefore I need to add the stamp text page by page cause i use the page height and width to place the stamp. I went ahead and wrote a test program that will apply multiple lines of stamp text to each page of the document.
