上記のようにAcroField.Itemを取得すると、次のように度単位でフィールドの回転を取得できます。
Dim widgetDict As PdfDictionary = Nothing
Dim mkDict As PdfDictionary = Nothing
Dim rNum As PdfNumber = Nothing
widgetDict = afi.widgets(0)
If Not widgetDict Is Nothing Then
mkDict = widgetDict.GetAsDict(PdfName.MK)
If Not mkDict Is Nothing Then
rNum = mkDict.GetAsNumber(PdfName.R)
If Not rNum Is Nothing Then
Return rNum.DoubleValue
End If
End If
End If
Return 0
これはAcroFieldの回転のみであることに注意してください。また、次のことを確認する必要があります。
- ページ自体も回転します(PDFReader.GetPageRotation(pageNo))
- フィールドの回転はページを基準にしています(iTextSharp.text.pdf.PdfFormField.FLAGS_NOROTATE)