當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfFormField.Get方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfFormField.Get方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfFormField.Get方法的具體用法?C# PdfFormField.Get怎麽用?C# PdfFormField.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfFormField的用法示例。


在下文中一共展示了PdfFormField.Get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ReplacePushbuttonField

 /**
 * Replaces the designated field with a new pushbutton. The pushbutton can be created with
 * {@link #getNewPushbuttonFromField(String,int)} from the same document or it can be a
 * generic PdfFormField of the type pushbutton.
 * @param field the field name
 * @param button the <CODE>PdfFormField</CODE> representing the pushbutton
 * @param order the field order in fields with same name
 * @return <CODE>true</CODE> if the field was replaced, <CODE>false</CODE> if the field
 * was not a pushbutton
 */
 public bool ReplacePushbuttonField(String field, PdfFormField button, int order)
 {
     if (GetFieldType(field) != FIELD_TYPE_PUSHBUTTON)
         return false;
     Item item = GetFieldItem(field);
     if (order >= item.Size)
         return false;
     PdfDictionary merged = item.GetMerged(order);
     PdfDictionary values = item.GetValue(order);
     PdfDictionary widgets = item.GetWidget(order);
     for (int k = 0; k < buttonRemove.Length; ++k) {
         merged.Remove(buttonRemove[k]);
         values.Remove(buttonRemove[k]);
         widgets.Remove(buttonRemove[k]);
     }
     foreach (PdfName key in button.Keys) {
         if (key.Equals(PdfName.T) || key.Equals(PdfName.RECT))
             continue;
         if (key.Equals(PdfName.FF))
             values.Put(key, button.Get(key));
         else
             widgets.Put(key, button.Get(key));
         merged.Put(key, button.Get(key));
     }
     return true;
 }
開發者ID:JamieMellway,項目名稱:iTextSharpLGPL-Monotouch,代碼行數:36,代碼來源:AcroFields.cs

示例2: AddRadioButton

 virtual public PdfFormField AddRadioButton(PdfFormField radiogroup, string value, float llx, float lly, float urx, float ury) {
     PdfFormField radio = PdfFormField.CreateEmpty(writer);
     radio.SetWidget(new Rectangle(llx, lly, urx, ury), PdfAnnotation.HIGHLIGHT_TOGGLE);
     string name = ((PdfName)radiogroup.Get(PdfName.V)).ToString().Substring(1);
     if (name.Equals(value)) {
         radio.AppearanceState = value;
     }
     else {
         radio.AppearanceState = "Off";
     }
     DrawRadioAppearences(radio, value, llx, lly, urx, ury);
     radiogroup.AddKid(radio);
     return radio;
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:14,代碼來源:PdfAcroForm.cs

示例3: ReplacePushbuttonField

 /**
 * Replaces the field with a new pushbutton. The pushbutton can be created with
 * {@link #getNewPushbuttonFromField(String)} from the same document or it can be a
 * generic PdfFormField of the type pushbutton.
 * @param field the field name
 * @param button the <CODE>PdfFormField</CODE> representing the pushbutton
 * @return <CODE>true</CODE> if the field was replaced, <CODE>false</CODE> if the field
 * was not a pushbutton
 */
 public bool ReplacePushbuttonField(String field, PdfFormField button)
 {
     if (GetFieldType(field) != FIELD_TYPE_PUSHBUTTON)
         return false;
     Item item = (Item)fields[field];
     PdfDictionary merged = (PdfDictionary)item.merged[0];
     PdfDictionary values = (PdfDictionary)item.values[0];
     PdfDictionary widgets = (PdfDictionary)item.widgets[0];
     for (int k = 0; k < buttonRemove.Length; ++k) {
         merged.Remove(buttonRemove[k]);
         values.Remove(buttonRemove[k]);
         widgets.Remove(buttonRemove[k]);
     }
     foreach (PdfName key in button.Keys) {
         if (key.Equals(PdfName.T) || key.Equals(PdfName.RECT))
             continue;
         merged.Put(key, button.Get(key));
         widgets.Put(key, button.Get(key));
     }
     return true;
 }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:30,代碼來源:AcroFields.cs


注:本文中的iTextSharp.text.pdf.PdfFormField.Get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。