PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Feb 01, 2023 3:37 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: Thu May 28, 2020 8:54 am 

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

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)

// 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...

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

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: No registered users and 12 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