

Writes PDF document to file and displays it PDFFormPushButton field = new PDFFormPushButton() įield.BackgroundColor = button.BackColor įield.Font = new PDFFont(new Font(,įield.Rectangle = new RectangleF(button.Left, Renders buttons as push button form fields PDFFormTextField field = new PDFFormTextField() įield.Font = new PDFFont(new Font(,įield.Rectangle = new RectangleF(text.Left,īutton button = this.Controls as Button Renders text boxes as text form fields Page.MeasurementUnit = PDFMeasurementUnit.Points įor (int i = 0 i < i++) Private void Form1_Closed(object sender, System.EventArgs e) Labels are rendered as formatted text in the PDF document. Buttons are converted to forms push buttons. Each text box in the form is rendered as a text form field in the output PDF document.
VISUAL STUDIO FORMAT DOCUMENT WITH CODE
When the form is closed, the forms document creation code in the event gets executed.

When you run the project, what you see is a Windows form with some text boxes, buttons and labels. here is the solution!įor this article, I created a C# project (offered as a download below) that creates PDF forms documents based on labels, text boxes, and buttons placed on a Windows form in Visual Studio. PDF form elements or form fields are not very different from the basic Windows controls, such as labels, text boxes, and buttons that you see in Microsoft Visual Studio®.Īnd, if you've been thinking if only there was a way you could create PDF forms documents with the same ease as creating Windows forms applications in Visual Studio, well.
