使用 Adobe JavaScript 将注释保存到 SQL Server 数据库中



我在尝试将带有注释的.pdf保存(插入(到 SQL Server 数据库中时遇到问题。该数据库位于Visual Studio中,我目前正在使用Adobe javascript来保存它,但是当我单击pdf中的按钮时,我遇到了安全设置,阻止访问此属性或方法。我正在使用尖顶的pdf按钮字段.pdf尝试保存到数据库中并将脚本传递到pdf javascript操作中。

到目前为止,我已经尝试使用受信任的权限功能,使用 adbc 连接和 odbc 连接以及 soap 方法,但它不起作用,我对下一步该做什么或继续感到非常迷茫。这些方法可以在Adobe javascript参考和api中找到。

PdfPageBase page = pdf.Pages[i];
PdfButtonField button = new PdfButtonField(page, "Save");
button.Bounds = new RectangleF(420, 10, 100, 40);
button.BorderColor = new PdfRGBColor(Color.AliceBlue);
button.BorderStyle = PdfBorderStyle.Solid;
button.ForeColor = new PdfRGBColor(Color.White);
button.Text = "Save";
button.BackColor = new PdfRGBColor(Color.Blue);
button.ToolTip = "Save";
button.Font = new PdfFont(PdfFontFamily.Helvetica, 9f);
pdf.Form.Fields.Add(button);
String script = "var nButton=app.alert({"
+ "    cMsg: "Do you want to save this paper into the database?","
+ "    nIcon: 2,"
+ "    nType : 2,"
+ "    cTitle: "Confirm Save?""
+ "});"
+ "if ( nButton == 4 ) {var myProxy = SOAP.connect("http://localhost:57103/test123.svc?wsdl) "); var testString = ("This is a test string"); var result = (myProxy.echoString(testString)); console.println("Result is :  + result")};";
PdfJavaScriptAction confirm = new PdfJavaScriptAction(script);
button.Actions.GotFocus = confirm;

我应该得到的预期结果是能够将带有注释的pdf保存到Visual Studio中的SQL Server数据库中,并能够使用注释检索它。但是,实际结果显示安全设置阻止访问此属性或方法,我无法继续。

非常感谢一些帮助,谢谢! :)

Acrobat JavaScript 中的 ADBC 自 Acrobat 9 以来默认处于关闭状态。若要激活 ADBC,请在以下位置创建名称为"bJSEnable"且值为"true"(1( 的 DWORD 类型的注册表项:

HKEY_CURRENT_USER\SOFTWARE\Adobe\Adobe Acrobat\VERSION\ADBC

此外,从 Acrobat 8.0 开始,SOAP 对象已被弃用。请改用 Net.SOAP。

最新更新