G
Guest
Hi there,
I have a PDF that has editable form fileds. I want to be able dynamically
fill in those form fields based on values I provide to the PDF. Right now, I
can create an instance of the object, open the PDF document, but can't get a
handle on the JavaScript portion of the document in order to change any of
the form field values.
Here is a snippet of my code so far:
Type AcroApp = Type.GetTypeFromCLSID(new
System.Guid("{85DE1C45-2C66-101B-B02E-04021C009402}"));
Type AcrobatType = Type.GetTypeFromCLSID(new
System.Guid("{72498821-3203-101B-B02E-04021C009402}"));
Type AcroPD = Type.GetTypeFromCLSID(new
System.Guid("{FF76CB60-2EC8-101B-B02E-04021C009402}"));
//create instances of the Acrobat objects needed
Acrobat.CAcroApp oApp = (Acrobat.CAcroApp) Activator.CreateInstance(AcroApp);
Acrobat.CAcroAVDoc avdoc= (Acrobat.CAcroAVDoc)
Activator.CreateInstance(AcrobatType);
Acrobat.CAcroPDDoc adoc = (Acrobat.CAcroPDDoc)
Activator.CreateInstance(AcroPD);
avdoc.Open(Server.MapPath("pdfs/test.pdf"),"test PDF");
adoc = (Acrobat.CAcroPDDoc)avdoc.GetPDDoc();
/* I need to get a hold of the form fields here and fill in their values */
oApp.Show(); //displays the proper PDF
adoc.Close();
Any help would be greately appreciated.
I have a PDF that has editable form fileds. I want to be able dynamically
fill in those form fields based on values I provide to the PDF. Right now, I
can create an instance of the object, open the PDF document, but can't get a
handle on the JavaScript portion of the document in order to change any of
the form field values.
Here is a snippet of my code so far:
Type AcroApp = Type.GetTypeFromCLSID(new
System.Guid("{85DE1C45-2C66-101B-B02E-04021C009402}"));
Type AcrobatType = Type.GetTypeFromCLSID(new
System.Guid("{72498821-3203-101B-B02E-04021C009402}"));
Type AcroPD = Type.GetTypeFromCLSID(new
System.Guid("{FF76CB60-2EC8-101B-B02E-04021C009402}"));
//create instances of the Acrobat objects needed
Acrobat.CAcroApp oApp = (Acrobat.CAcroApp) Activator.CreateInstance(AcroApp);
Acrobat.CAcroAVDoc avdoc= (Acrobat.CAcroAVDoc)
Activator.CreateInstance(AcrobatType);
Acrobat.CAcroPDDoc adoc = (Acrobat.CAcroPDDoc)
Activator.CreateInstance(AcroPD);
avdoc.Open(Server.MapPath("pdfs/test.pdf"),"test PDF");
adoc = (Acrobat.CAcroPDDoc)avdoc.GetPDDoc();
/* I need to get a hold of the form fields here and fill in their values */
oApp.Show(); //displays the proper PDF
adoc.Close();
Any help would be greately appreciated.