PDFドキュメントにプッシュボタンを作成し、アクション(GoToLocalPage)を設定したい:
PushButton:=New PushbuttonField(stamper.writer, New Rectangle(300, 300,330,330),"Text");
PushButton.Image:=img;
PushButton.ProportionalIcon:=True;
PushButton.Layout:=PushbuttonField.LAYOUT_ICON_ONLY;
PushButton.Field.Action:=PdfAction.GotoLocalPage(2, New PdfDestination(PdfDestination.FIT), stamper.Writer);
stamper.AddAnnotation(PushButton.Field,5);
その結果、アクションは機能しません。私は何を間違っていますか?
書かれたすべての例で: PushButton.GetFields().SetAction(...)。しかし、iTextSharp 5.3.3 メソッド GetFields には存在しません...
私は試した:
Action:=PdfAction.GotoLocalPage(2, New PdfDestination(PdfDestination.FIT), stamper.Writer);
PushButton.Field.SetAdditionalActions(iTextSharp.text.pdf.PdfName.D, Action);
しかし、それも機能していません..