Hi all,
I m trying to embed the following javascript to for my pdf.
var myURL = "http://localhost:60494/Service1.svc?wsdl"; var myProxy = SOAP.connect(myURL); var filename = documentFileName; var testString = { soapType: "xsd:string", testString: filename }; var result = myProxy.updateDB(testString);
now my problem is that when i tried to add them into pdfdictionary
dict.Elements["/S"] = new PdfName("/JavaScript"); dict.Elements["/JS"] = new PdfName("/var myURL = \"http://localhost:60494/Service1.svc?wsdl\"; var myProxy = SOAP.connect(myURL); var filename = documentFileName; var testString = {soapType: \"xsd:string\", testString: filename}; var result = myProxy.updateDB(testString);");
it doesnt make into the pdf document. However, if i remove the line -->var testString = {soapType: \"xsd:string\", testString: filename}; <-- and only do
dict.Elements["/JS"] = new PdfName("/var myURL = \"http://localhost:60494/Service1.svc?wsdl\"; var myProxy = SOAP.connect(myURL); var filename = documentFileName; var result = myProxy.updateDB(testString);");
then everything is fine... so.. am i missing something?
Thanks all!
update: after a bit more testing the issue is this character { and }. remove them, will make it work, but at this point, javascript wont work.... sigh.. looks like problem should trace to how the stream is being write to the file... one of those write function in PDFSharp.Pdf.IO.PdfWriter is prolly not handling the special char { and } correctly.
|