繁体   English   中英

使用 adobe 将注释保存到 SQL 服务器数据库 javascript

[英]Save annotations into SQL Server database using adobe javascript

我在尝试将带有注释的.pdf保存(插入)到 SQL 服务器数据库时遇到问题。 该数据库位于 Visual Studio 内,我目前正在使用 adobe javascript 来保存它,但是当我单击 pdf 内的按钮时,我遇到了安全设置阻止访问此属性或方法。 I'm using a pdf button field from spire.pdf to try to save into the db and pass the script into pdf javascript action.

到目前为止,我已经尝试使用受信任的特权 function,使用 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 服务器数据库中,并能够使用注释检索它。 但是,实际结果显示安全设置阻止访问此属性或方法,我无法继续。

非常感谢您的帮助,谢谢::)

Acrobat JavaScript 中的 ADBC 自 Acrobat 9 以来默认已关闭。要激活 ADBC,请在以下位置创建一个名为“bJSEnable”且值为“true”(1) 的 DWORD 类型的注册表项:

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

此外,从 Acrobat 8.0 开始,不推荐使用 SOAP object。 请改用 Net.SOAP。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM