예제 #1
0
        protected void ManipulatePdf(String dest)
        {
            PdfDocument  pdfDoc = new PdfDocument(new PdfReader(SRC), new PdfWriter(dest));
            PdfAcroForm  form   = PdfAcroForm.GetAcroForm(pdfDoc, true);
            PdfFormField button = form.CopyField("Test");
            PdfArray     rect   = button.GetWidgets()[0].GetRectangle();

            // Increase value of the right coordinate (index 2 corresponds with right coordinate)
            rect.Set(2, new PdfNumber(rect.GetAsNumber(2).FloatValue() + 172));

            button.SetValue("Print Amended");
            form.ReplaceField("Test", button);

            pdfDoc.Close();
        }