I'm using the iText library within Cold Fusion Scripting <cfscript> and have run into some problems manipulating forms, I cannot copy form fields or add elements such as a button. I have tried both with and without the Cold Fusion javacast functions and I have tried many other code variations but it should be clear what I'm trying to do in each case below, I believe the problems I am having are related, here is my code and the two error messages I am getting...

-------- BEGIN PROBLEM #1 - ADD A SUBMIT BUTTON ---------
The selected method addHtmlPostButton was not found.

Either there are no methods with the specified method name and argument types, or the method addHtmlPostButton is overloaded with arguments types that ColdFusion can't decipher reliably. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.
 
The error occurred in E:\Inetpub\customers\AdSoft\web\Modules\previewPDF.cfm: line 180

178 :   appaddress = "http://www.adsoftdirect.com/index.cfm?page=processfdf";
179 :   PRAcroForm = createObject("java", "com.lowagie.text.pdf.PRAcroForm");
180 :   PRAcroForm.addHtmlPostButton(javacast("string", "btn"), javacast("string", "SUBMIT"), javacast("string", "noValue"), javacast("string", appAddress), javacast("string", "arial"), javacast("int", "14"), javacast("int", "355"), javacast("int", "700"), javacast("int", "420"), javacast("int", "725"));
181 :   document.close();
-------- END PROBLEM #1 - ADD A SUBMIT BUTTON ---------

-------- BEGIN PROBLEM #2 - COPY FORM FIELDS ---------
The selected method addDocument was not found.

Either there are no methods with the specified method name and argument types, or the method addDocument is overloaded with arguments types that ColdFusion can't decipher reliably. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.
 
The error occurred in E:\Inetpub\customers\AdSoft\web\Modules\previewPDF.cfm: line 182
180 :           formCheck = newreader.getAcroForm();
181 :   if (isDefined("formCheck")) {
182 :                   writer.addDocument(newreader);
183 :           }
-------- END PROBLEM #2 - COPY FORM FIELDS ---------

Reply via email to