PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu May 25, 2017 2:33 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Sep 12, 2016 10:45 am 
Offline

Joined: Mon Sep 05, 2016 7:54 am
Posts: 22
I am writing a program to fill Text Fields in a PDF that's loaded from memory. The PDF features a number of Text Fields, but also has some other types of Fields such as Check Boxes and Combo Boxes.

I am currently just using
Code:
PdfTextField currField = (PdfTextField)inForm.Fields[elementName];
currField.Value = new PdfString(elementValue);


to set the value of each text box, however if one of the other Fields, e.g a checkbox is chosen, then I will obviously get a cast exception. So how can I check that the AcroField is a TextBox before I set it's value?

Thanks, RBrNx


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group