以编程方式启用Adobe PDF使用权 [英] Programmatically enable Adobe PDF usage rights

查看:157
本文介绍了以编程方式启用Adobe PDF使用权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以通过编程方式从.net代码启用Adobe PDF使用权限? 我正在使用ITextSharp库用XML数据(从应用程序生成)填充XFA表单, 但是输出的PDF没有启用使用权,因此用户无法与之交互(通常不会出现问题,但是原始PDF是由gov提供的,并且 用户必须单击一些验证按钮,并且该过程是用户/公司特定的)

Is there any way to programmatically enable Adobe PDF usage rights from .net code ? I'm using ITextSharp library to fill an XFA Form with XML Data (generated from app), but the output PDF does not have usage rights enabled, thus the users cannot interact with it (that wouldn't normally be a problem, BUT the original PDF is gov supplied, and the user must click some validation buttons, and that process is user/company specific)

这可以通过Adobe Reader手动完成,但是您必须具有Adobe Acrobat专业许可证.

This could be manually accomplished from Adobe Reader but you have to have an adobe acrobat professional licence..

Google说只有Adobe产品才能做到这一点". ( http://old.nabble.com/Enable-Adobe -Reader-usage-rights-td14276927.html )

Google is saying that "Only Adobe products can do that" .. (http://old.nabble.com/Enable-Adobe-Reader-usage-rights-td14276927.html)

string pathPDF = @"C:\original.pdf";
string pathCreated = @"C:\created.pdf";
string pathXml = @"C:\data.xml";

using (PdfStamper stamper = new PdfStamper(new PdfReader(pathPDF), System.IO.File.OpenWrite(pathCreated)))
{
    stamper.FormFlattening = false;
    stamper.AcroFields.Xfa.FillXfaForm(pathXml);

    stamper.Close();
}

推荐答案

以编程方式执行此操作的唯一方法是使用Adobe Reader Extension Server.您可以在此处查看Adobe白皮书: http://www.adobe. com/sea/products/server/readerextensions/pdfs/readerextensionsserver_ds.pdf

The only way to do it programitically is to use Adobe Reader Extension Server. You can review Adobe whitepaper here: http://www.adobe.com/sea/products/server/readerextensions/pdfs/readerextensionsserver_ds.pdf

在上述情况下,您将使用iTextSharp创建Pdf文档,然后使用Adobe Reader Extension Server允许Pdf文档在Adobe Reader中具有扩展功能.

In the case above you would use iTextSharp to create Pdf document and then use Adobe Reader Extension Server to allow Pdf document to have extended functionality in Adobe Reader.

但是,有一个小窗口可让您使用iTextSharp并填写已经启用了Reader的PDF文档.如果您有这样的Pdf文档(启用了阅读器),则可以使用iText/iTextSharp来填充XFA数据.您可以在此处查看示例: http://itextpdf.com/examples/iia.php?id=166

However, there is a small window that allows you to work with iTextSharp and fill-in already Reader-enabled PDF documents. If you have such Pdf document (Reader Enabled), then you can use iText/iTextSharp to fill in XFA data. You can check example here: http://itextpdf.com/examples/iia.php?id=166

祝你好运!

这篇关于以编程方式启用Adobe PDF使用权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆