Quantcast

Re: itextsharp bug (i think) and fix

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: itextsharp bug (i think) and fix

blowagie
Wayne Quinlivan-Smith wrote:
>
> Hi Bruno

Hi,
I'm sorry for the delay. I went from meeting to meeting again today,
and when I got home, I saw the quota of my INBOX was exceeded.
I'm struggling through my mail and I won't be able to answer all
questions, therefore I'm forwarding this to the mailing list: THE
most important iText address, as all messages are archived and
therefore never lost (even if my personal mailbox is full).

> I've been using iTextSharp on a project recently. I created a PDF using
> LiveCycle which had a master page that contained some textfields. My
> intention was to set the acrofields in the document and hopefully have
> the values appear on each of the pages. However, when I tried to set the
> values using the SetField method of the AcroFields object an xml
> exception was thrown saying that # is invalid in an xml name. It appears
> that the GetShortName method of the Xml2Som object parses out the string
> "#subform[xx]." from the name. It seems that when you use pdf master
> pages an extra node is inserted into the name: "#pageSet[xx]". I changed
> the GetShortName method to the following, which seemed to fix the
> problem (no exception, field being populated):
>
>            public static String GetShortName(String s) {
>                 Regex subformPattern = new Regex(@"#subform\[\d+\]\.",
> RegexOptions.IgnoreCase);
>                 Regex pageSetPattern = new Regex(@"#pageset\[\d+\]\.",
> RegexOptions.IgnoreCase);
>                 s = subformPattern.Replace(s, string.Empty);
>                 s = pageSetPattern.Replace(s, string.Empty);
>                 return s;
>             }
>
> The only problem that seems to remain is that the field that I thought
> would be populated in each page, is only populated in the first page
> (despite being in a master page). I assume that each field is rendered
> with a unique pdf object reference, which would explain SetField's
> behaviour. I don't suppose you have a quick workaround for this do you?
>
> Best regards,
> Wayne

-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: itextsharp bug (i think) and fix

Paulo Soares
Please post the PDF and the code so that the problem can be reproduced.

Paulo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Bruno Lowagie
> Sent: Wednesday, May 30, 2007 4:20 PM
> To: Wayne Quinlivan-Smith; Post all your questions about iText here
> Subject: Re: [iText-questions] itextsharp bug (i think) and fix
>
> Wayne Quinlivan-Smith wrote:
> >
> > Hi Bruno
>
> Hi,
> I'm sorry for the delay. I went from meeting to meeting again today,
> and when I got home, I saw the quota of my INBOX was exceeded.
> I'm struggling through my mail and I won't be able to answer all
> questions, therefore I'm forwarding this to the mailing list: THE
> most important iText address, as all messages are archived and
> therefore never lost (even if my personal mailbox is full).
>
> > I've been using iTextSharp on a project recently. I created
> a PDF using
> > LiveCycle which had a master page that contained some
> textfields. My
> > intention was to set the acrofields in the document and
> hopefully have
> > the values appear on each of the pages. However, when I
> tried to set the
> > values using the SetField method of the AcroFields object an xml
> > exception was thrown saying that # is invalid in an xml
> name. It appears
> > that the GetShortName method of the Xml2Som object parses
> out the string
> > "#subform[xx]." from the name. It seems that when you use
> pdf master
> > pages an extra node is inserted into the name:
> "#pageSet[xx]". I changed
> > the GetShortName method to the following, which seemed to fix the
> > problem (no exception, field being populated):
> >
> >            public static String GetShortName(String s) {
> >                 Regex subformPattern = new
> Regex(@"#subform\[\d+\]\.",
> > RegexOptions.IgnoreCase);
> >                 Regex pageSetPattern = new
> Regex(@"#pageset\[\d+\]\.",
> > RegexOptions.IgnoreCase);
> >                 s = subformPattern.Replace(s, string.Empty);
> >                 s = pageSetPattern.Replace(s, string.Empty);
> >                 return s;
> >             }
> >
> > The only problem that seems to remain is that the field
> that I thought
> > would be populated in each page, is only populated in the
> first page
> > (despite being in a master page). I assume that each field
> is rendered
> > with a unique pdf object reference, which would explain SetField's
> > behaviour. I don't suppose you have a quick workaround for
> this do you?
> >
> > Best regards,
> > Wayne

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



-------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: itextsharp bug (i think) and fix

minh
This post has NOT been accepted by the mailing list yet.
Hi, I have the same problem as the above poster. Has any fix been done for this issue with "#pageSet"?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: itextsharp bug (i think) and fix

blowagie
This post has NOT been accepted by the mailing list yet.
You are replying to a question dating from 2007!
Also: Nabble is not an official channel to post questions.
Go to http://itextpdf.com/support to learn how to get support.

Nobody, I repeat: NOBODY but me is still following Nabble, and I am not answering questions here.
Use the proper channel!
Loading...