2009-06-04 3 views
0

iTextSharp AcroField를 쿼리하여 회전 여부를 확인하고 회전 값을 캡처합니다.iTextSharp로 텍스트 필드 회전을 얻는 방법

그래서 나는 다음 필드가있는 경우 :

Dim af As iTextSharp.text.pdf.AcroFields = stamper.AcroFields 
Dim afi As iTextSharp.text.pdf.AcroFields.Item 

afi = af.GetFieldItem("fieldName") 

내가 특정 필드의 (도) 회전을 얻으려면 어떻게해야합니까?

답변

0

위 그림과 같이 당신이 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를 기준으로합니다. 깃발 없음)