PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Nov 01, 2024 12:38 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Oct 29, 2006 2:32 pm 
Offline

Joined: Sun Oct 29, 2006 2:22 pm
Posts: 1
Greetings. I am receiving an error when trying to fill in an existing PDF's form fields, but I'm not sure what it means. I was wondering if anyone here could shed some light on the error message.

The error message reads: "The size of the XPdfForm is to small. Parameter Name: size."

The offending code is found in the if statement of the following code block, where "fields" is a PdfAcroFieldCollection and "FFELPForm" is an ASP Wizard control.

Code:
PdfAcroField fNonLoanCode = fields["NonLoanCode" + i.ToString()];

if ((txtField = fNonLoanCode as PdfTextField) != null) { txtField.Text = ((DropDownList)FFELPForm.FindControl( "NonLoanCode" + i.ToString() )).SelectedValue; }


I'm not sure what property of the PDF document the error refers to; is it the actual pixel width of field? Is it the allowed characters of the field? Etc. At the point the error is thrown, the "SelectedValue" that I'm trying to fill the field with is only two characters long.

Any ideas?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 12:13 am 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
Hello

>>Any ideas?

Yes, I wrote in the FillFormFields Sample (which is not in the Samples solution anymore):

Code:
Note: AcroForms are still under construction in this version. Filling form fields is more obscure than I expected. The implementation is partially undone.


This simply means the AcroForm stuff is incomplete and untested. We currently don’t need AcroForms in our own projects. I have not removed the source code from PDFsharp because it may be useful for somebody.

Sorry
Stefan Lange


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 29, 2006 7:13 pm 
Offline

Joined: Wed Nov 29, 2006 6:47 pm
Posts: 1
I ran into the same issue and found that the issue arose when there were multiple fields with the exact same name. So tertiumquid could get around it by adjusting names slightly.

I'm using PdfSharp to auto fill forms and I made it so the form could have any number it wanted at the end and I only looked at the text so "address" filled in the same as "address12312" or "address32".

But thats just a work around. I poked around a bit inside the pdf and I know what it's doing now I think. I poked around the code a bit and it just didn't pop out at me as to how it works (the parsing and reading of all the tags and where they're stored and such) but if I could get an overview and a start I'd work on fixing it myself.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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