You'll need a PushbuttonField for the AcroForm and a XFA modification to 
identify the button. You have in the Adobe site the pdf reference and the 
pdf reference. The easiest way is to crete the button in Designer and see 
what XML is created.

Paulo

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, June 13, 2007 2:44 AM
Subject: Re: [iText-questions] Designer & RadioButton work-around?


So let me rehash what you're saying to be clear.

You are recommending the solution around the "Expected a name object" error 
is to not use the PdfCopyFields process because it probably doesn't work 
with Designer Forms because it is converting the form to an AcroForm (hence 
the reason it shrunk from 20KB to 10KB).

Then in place of the PushbuttonField, implement an XFA specific solution. 
Can you give me a few other pointers or recommendations on how to best 
implement this and good resource references?  Or could I cheat and insert a 
JavaScript method to create the button realtime (assuming insert of 
JavaScript works for Designer Forms).  Therefore when the user opens the 
PDF, run a JavaScript method that creates the button using Adobe's own 
JavaScript API?

Shane


-------------- Original message -------------- 
From: "Paulo Soares" <[EMAIL PROTECTED]>

> Designer support in iText is limited to setField(). It is possible to add 
> a
> button but you'll have to change the template section of the XFA yourself
> and insert the button acroform in the right place. It's not rocket science
> but it's still some work.
>
> Paulo
>
> ----- Original Message ----- 
> From:
> To:
> Cc: "Paulo Soares"
> Sent: Saturday, June 09, 2007 12:30 AM
> Subject: Re: [iText-questions] Designer & RadioButton work-around?
>
>
> >I have attached the source and sample PDF.
> >
> > I have two rendering methods producing different results. The first
> > (renderTestPdfByteWise) is close to what we are doing today in the Web
> > Application (dealing with bytes and such). The second is smaller
> > (renderTestPdf) which doesn't actually seem to be creating the button
> > right.
> >
> > Anyhow the first case produces the error message when you click the Test
> > Submit button. I also noticed the PDF is about half the size of the
> > original so it's probably cutting something out. Given that fact 
> > however,
> > if you click the default choice (i.e. C), and then click submit, it will
> > work just fine.
> >
> > As an FYI, these are radio buttons, but just being rendered using 
> > squares
> > so when forms filled out by hand. I have tried as standard radiobuttons
> > as well and is exact same problem.
> >
> > Anyhow thanks for the follow-up.
> > Shane
> >
> > -------------- Original message ---------------------- 
> > From: "Paulo Soares"
> >> setField() should work for all objects in Designer forms. Please post 
> >> the
> >> form and a small sample of the code used to fill it (with harcoded
> >> values).
> >> It may be a bug.
> >>
> >> Paulo
> >>
> >> ----- Original Message ----- 
> >> From:
> >> To:
> >> Sent: Friday, June 08, 2007 9:48 PM
> >> Subject: [iText-questions] Designer & RadioButton work-around?
> >>
> >>
> >> I know by default iText is not working completely with Designer 
> >> designed
> >> forms. My current client is using Designer for which I have little
> >> control
> >> and for everything but radiobuttons, iText is working fine.
> >>
> >> Basically a user requests a form from the server and using iText I
> >> prefill
> >> the data. If I don't prefill the radiobutton choices, I don't get the
> >> "Expected a name object" error upon form submission, but if I use the
> >> setField method on a radiobutton field, then it produces the "Expected 
> >> a
> >> name object" error upon submission of the form. Ironically if the 
> >> person
> >> clicks on the choice I have selected for them, then the error will not
> >> occur
> >> and if I flatten the field, it works too.
> >>
> >> My question is whether there are work arounds or suggestions from 
> >> others
> >> on
> >> how to deal with this since. I looked in the archives and haven't seen 
> >> a
> >> post on this since 2005. I have two thoughts on potential solutions but
> >> would like some input:
> >>
> >> 1) Figure out how to save the form from designer in a way that is
> >> compatible with iText (i.e. remove the XML based portion in PDF).
> >>
> >> 2) Insert some JavaScript via iText that would run when the form is
> >> loaded
> >> to set the fields internally. Since I only have about 4 radio button
> >> sections, this should run pretty quickly and I would assume Adobe's own
> >> JavaScript would work without causing this error.
> >>
> >> And no I can't switch them from radio buttons since this form is both
> >> electronic and by hand. Anyhow suggestions would be greatly 
> >> appreciated.
> >>
> >> Thanks,
> >> Shane


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to