Hello,


A few months back, I submitted a code change (below) to the FdfWriter and 
PdfName classes.  This code change set a Status dictionary in the FDF that 
would trigger a Javascript alert that I am using for AcroForm validation.  This 
change was forwarded to your developers for consideration in the 5.4.2 release, 
but I have not noticed the changes implemented.  Is this still under 
consideration?



Thank you!



Chet Potvin



Message: 1

Date: Sat, 13 Apr 2013 10:22:35 +0200

From: 1T3XT BVBA <i...@1t3xt.info<mailto:i...@1t3xt.info>>

Subject: Re: [iText-questions] iTextSharp FdfWriter - Status Message

                Modification

To: Post all your questions about iText here

                
<itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>>

Message-ID: <516915cb.2050...@1t3xt.info<mailto:516915cb.2050...@1t3xt.info>>

Content-Type: text/plain; charset=ISO-8859-1; format=flowed



On 12/04/2013 23:24, Potvin, Chet wrote:

> Can this simple code change be considered for contribution to the

> iText code base?

Yes,

I'll forward this to our developers.

We've just released iText 5.4.1, but your extra lines will probably be added to 
5.4.2.





Message: 6

Date: Fri, 12 Apr 2013 21:24:48 +0000

From: "Potvin, Chet" 
<chet.pot...@allscripts.com<mailto:chet.pot...@allscripts.com>>

Subject: [iText-questions] iTextSharp FdfWriter - Status Message

                Modification

To: 
"itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>"

                
<itext-questions@lists.sourceforge.net<mailto:itext-questions@lists.sourceforge.net>>

Message-ID:

                
<07a20315674b834aa68a24a59f8646b337542...@corpexm1.corp.allscripts.com<mailto:07a20315674b834aa68a24a59f8646b337542...@corpexm1.corp.allscripts.com>>



Content-Type: text/plain; charset="us-ascii"



I would like to be able to use the FdfWriter class to send a Status message 
back to the AcroForm that is displayed as an Adobe Javascript alert.  This 
allows me to perform server-side validation of some form inputs and return a 
message to the user if something needs attention.  This is similar to the 
FdfDoc.FDFSetStatus(string message) method in Adobe's FDF Toolkit.



In order to support this functionality, I had to modify the FdfWriter class to 
include this private variable and property:



                private string statusMessage;



public string StatusMessage

{

   get { return this.statusMessage; }

   set { this.statusMessage = value; }

}



In the internal Wrt class, which is in the same class file as FdfWriter, I 
added the starred code inside the WriteTo() method:



internal void WriteTo()

{

                PdfDictionary dic = new PdfDictionary();

                PdfArray fieldArray = Calculate(fdf.fields);



                dic.Put(PdfName.FIELDS, fieldArray);



                if (fdf.file != null)

                    dic.Put(PdfName.F, new PdfString(fdf.file, 
PdfObject.TEXT_UNICODE));



*               if (!string.IsNullOrEmpty(fdf.statusMessage))

*                   dic.Put(PdfName.STATUS, new PdfString(fdf.statusMessage));





                PdfDictionary fd = new PdfDictionary();

                fd.Put(PdfName.FDF, dic);

                PdfIndirectReference refi = AddToBody(fd).IndirectReference;





                byte[] b = GetISOBytes("trailer\n");

                os.Write(b, 0, b.Length);

                PdfDictionary trailer = new PdfDictionary();

                trailer.Put(PdfName.ROOT, refi);

                trailer.ToPdf(null, os);



                b = GetISOBytes("\n%%EOF\n");

                os.Write(b, 0, b.Length);

                os.Close();

}



You may also notice that I've included a new PdfName called STATUS.  I added 
this line of code to the PdfName class:



        public static readonly PdfName STATUS = new PdfName("Status");



Can this simple code change be considered for contribution to the iText code 
base?  Please let me know if you see any portability issues between C# and 
Java, since I'm a Microsoftie.



Thank you,




Chet Potvin | Sr. Software Engineer | Care Coordination and Analytics
Allscripts | 8700 W. Bryn Mawr Ave. | Suite 700N | Chicago, IL | 60631
773.632.1552 | P
888.446.2022 | F
chet.pot...@allscripts.com | www.allscripts.com<http://www.allscripts.com/>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to