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


C# PdfFormField.SetAppearance方法代碼示例

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


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

示例1: DrawRadioAppearences

 virtual public void DrawRadioAppearences(PdfFormField field, string value, float llx, float lly, float urx, float ury) {
     PdfAppearance tpOn = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     tpOn.DrawRadioField(0f, 0f, urx - llx, ury - lly, true);
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, value, tpOn);
     PdfAppearance tpOff = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     tpOff.DrawRadioField(0f, 0f, urx - llx, ury - lly, false);
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Off", tpOff);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:8,代碼來源:PdfAcroForm.cs

示例2: DrawSignatureAppearences

 /**
  * @param field
  * @param llx
  * @param lly
  * @param urx
  * @param ury
  */
 virtual public void DrawSignatureAppearences(PdfFormField field, float llx, float lly, float urx, float ury) {
     PdfAppearance tp = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     tp.SetGrayFill(1.0f);
     tp.Rectangle(0, 0, urx - llx, ury - lly);
     tp.Fill();
     tp.SetGrayStroke(0);
     tp.SetLineWidth(1);
     tp.Rectangle(0.5f, 0.5f, urx - llx - 0.5f, ury - lly - 0.5f);
     tp.ClosePathStroke();
     tp.SaveState();
     tp.Rectangle(1, 1, urx - llx - 2, ury - lly - 2);
     tp.Clip();
     tp.NewPath();
     tp.RestoreState();
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, tp);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:23,代碼來源:PdfAcroForm.cs

示例3: DrawCheckBoxAppearences

 virtual public void DrawCheckBoxAppearences(PdfFormField field, string value, float llx, float lly, float urx, float ury) {
     BaseFont font = BaseFont.CreateFont(BaseFont.ZAPFDINGBATS, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
     float size = (ury - lly);
     PdfAppearance tpOn = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     PdfAppearance tp2 = (PdfAppearance)tpOn.Duplicate;
     tp2.SetFontAndSize(font, size);
     tp2.ResetRGBColorFill();
     field.DefaultAppearanceString = tp2;
     tpOn.DrawTextField(0f, 0f, urx - llx, ury - lly);
     tpOn.SaveState();
     tpOn.ResetRGBColorFill();
     tpOn.BeginText();
     tpOn.SetFontAndSize(font, size);
     tpOn.ShowTextAligned(PdfContentByte.ALIGN_CENTER, "4", (urx - llx) / 2, (ury - lly) / 2 - (size * 0.3f), 0);
     tpOn.EndText();
     tpOn.RestoreState();
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, value, tpOn);
     PdfAppearance tpOff = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     tpOff.DrawTextField(0f, 0f, urx - llx, ury - lly);
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, "Off", tpOff);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:21,代碼來源:PdfAcroForm.cs

示例4: DrawMultiLineOfText

 virtual public void DrawMultiLineOfText(PdfFormField field, string text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) {
     PdfAppearance tp = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     PdfAppearance tp2 = (PdfAppearance)tp.Duplicate;
     tp2.SetFontAndSize(font, fontSize);
     tp2.ResetRGBColorFill();
     field.DefaultAppearanceString = tp2;
     tp.DrawTextField(0f, 0f, urx - llx, ury - lly);
     tp.BeginVariableText();
     tp.SaveState();
     tp.Rectangle(3f, 3f, urx - llx - 6f, ury - lly - 6f);
     tp.Clip();
     tp.NewPath();
     tp.BeginText();
     tp.SetFontAndSize(font, fontSize);
     tp.ResetRGBColorFill();
     tp.SetTextMatrix(4, 5);
     System.util.StringTokenizer tokenizer = new System.util.StringTokenizer(text, "\n");
     float yPos = ury - lly;
     while (tokenizer.HasMoreTokens()) {
         yPos -= fontSize * 1.2f;
         tp.ShowTextAligned(PdfContentByte.ALIGN_LEFT, tokenizer.NextToken(), 3, yPos, 0);
     }
     tp.EndText();
     tp.RestoreState();
     tp.EndVariableText();
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, tp);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:27,代碼來源:PdfAcroForm.cs

示例5: DrawSingleLineOfText

 virtual public void DrawSingleLineOfText(PdfFormField field, string text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) {
     PdfAppearance tp = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     PdfAppearance tp2 = (PdfAppearance)tp.Duplicate;
     tp2.SetFontAndSize(font, fontSize);
     tp2.ResetRGBColorFill();
     field.DefaultAppearanceString = tp2;
     tp.DrawTextField(0f, 0f, urx - llx, ury - lly);
     tp.BeginVariableText();
     tp.SaveState();
     tp.Rectangle(3f, 3f, urx - llx - 6f, ury - lly - 6f);
     tp.Clip();
     tp.NewPath();
     tp.BeginText();
     tp.SetFontAndSize(font, fontSize);
     tp.ResetRGBColorFill();
     tp.SetTextMatrix(4, (ury - lly) / 2 - (fontSize * 0.3f));
     tp.ShowText(text);
     tp.EndText();
     tp.RestoreState();
     tp.EndVariableText();
     field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, tp);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:22,代碼來源:PdfAcroForm.cs

示例6: DrawButton

 virtual public void DrawButton(PdfFormField button, string caption, BaseFont font, float fontSize, float llx, float lly, float urx, float ury) {
     PdfAppearance pa = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     pa.DrawButton(0f, 0f, urx - llx, ury - lly, caption, font, fontSize);
     button.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, pa);
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:5,代碼來源:PdfAcroForm.cs

示例7: AddMap

 virtual public PdfFormField AddMap(string name, string value, string url, PdfContentByte appearance, float llx, float lly, float urx, float ury) {
     PdfAction action = PdfAction.CreateSubmitForm(url, null, PdfAction.SUBMIT_HTML_FORMAT | PdfAction.SUBMIT_COORDINATES);
     PdfFormField button = new PdfFormField(writer, llx, lly, urx, ury, action);
     SetButtonParams(button, PdfFormField.FF_PUSHBUTTON, name, null);
     PdfAppearance pa = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
     pa.Add(appearance);
     button.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, pa);
     AddFormField(button);
     return button;
 }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:10,代碼來源:PdfAcroForm.cs


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