2012-02-08 36 views

答えて

2

PdfStamperを使用して、既存のPDFにPushbuttonFieldを追加します。ページ上の位置、フィールドの名前、およびページ番号を指定します。

static void AddPushbuttonField(string inputFile, iTextSharp.text.Rectangle buttonPosition, string buttonName, string outputFile) 
{ 
    using (PdfStamper stamper = new PdfStamper(new PdfReader(inputFile), File.Create(outputFile))) 
    { 
     PushbuttonField buttonField = new PushbuttonField(stamper.Writer, buttonPosition, buttonName); 

     stamper.AddAnnotation(buttonField.Field, 1); 
     stamper.Close(); 
    } 
} 

また、iText in Actionもご覧ください。 Chapter 8には、PushbuttonFieldの作成例と、設定可能なさまざまなプロパティの例があります。

関連する問題