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

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

问题描述

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

Is there any way to programatically 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..

谷歌说只有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();
        }


推荐答案

唯一的办法programitically是使用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并填写已读取的内容 - 启用PDF文档。如果您有这样的Pdf文档(Reader Enabled),那么您可以使用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天全站免登陆