Ideally, I am trying to trigger an event in a PDF, using iTextSharp. Failing that, I would like to know if I can trigger a function.
Basically, I'm just trying to get a handle of the document through javascript.
This works in the PDF
(Using LiveCycle):
eApp.Page1.FormPurpose_PolicyNumber::click -
(JavaScript, client)
this.rawValue = "hello";
From C# I can't get a handle on the doc, eApp
in this case.
var reader = new PdfReader(pdfFileStream);
var writer = new PdfStamper(reader, outputStream);
THIS WORKS:(app object)
PdfAction js =
PdfAction.JavaScript(
"app.alert('hello');",
writer.Writer);
writer.Writer.AddJavaScript(js);
THIS DOES NOT:
PdfAction js =
PdfAction.JavaScript(
"eApp.Page1.FormPurpose_PolicyNumber.execEvent('click');",
writer.Writer);
writer.Writer.AddJavaScript(js);
Also doesn't work:
PdfAction js =
PdfAction.JavaScript(
"eApp.Page1.FormPurpose_PolicyNumber.rawValue= 'hello'",
writer.Writer);
writer.Writer.AddJavaScript(js);
I have looked for the answer high and low, but have not been able to find it, yes there are similar questions, but either they are not answered or are very different than what I'm doing.