Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
151330 | Feb 7,2020 02:21 AM UTC | Feb 7,2020 12:07 PM UTC | WinForms | 1 |
![]() |
Tags: PDF |
//Create a new PDF document
PdfDocument document = new PdfDocument();
//Add a new page to the PDF document
PdfPage page = document.Pages.Add();
document.Form.SetDefaultAppearance(false);
//Create a textbox field and add the properties
PdfTextBoxField textBoxField = new PdfTextBoxField(page, "FirstName");
textBoxField.Bounds = new RectangleF(0, 0, 100, 20);
textBoxField.ToolTip = "First Name";
//Set the font with style
textBoxField.Font = new PdfStandardFont(PdfFontFamily.TimesRoman, 12, PdfFontStyle.Bold | PdfFontStyle.Italic | PdfFontStyle.Underline | PdfFontStyle.Strikeout);
textBoxField.Text = "Hello World Hello";
//Add the form field to the document
document.Form.Fields.Add(textBoxField);
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.