PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Sep 18, 2020 10:38 am

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: Thu May 28, 2020 8:54 am 
Offline

Joined: Thu May 28, 2020 8:41 am
Posts: 1
Hi,

I'm trying to fill a PDF form with PDFsharp and there is no problems for fields like PdfTextField or PdfCheckBoxField.
But i encounter two problems with the ComboBoxField :
- I don't understand how to modify (add, delete or modify) the list of the values available for the combo field.
- Setting the value doesn't seem to works (My example code is right below)

Code:
           
// Open the file
PdfDocument pdf = PdfReader.Open(pdfFilePath);

PdfComboBoxField comboBoxField = (PdfComboBoxField)(pdf.AcroForm.Fields["FRM_CRM1_Marque"]);

if (comboBoxField != null)
{
    comboBoxField.Value = new PdfString("Choice 1");
}

// Save the document...
pdf.Save(pdfFillFilePath);
pdf.Close();


Do you know if it is possible to solve my two problems and how please?


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: Google [Bot] and 15 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group