用pdfsharp添加acroform [英] Add acroform with pdfsharp

查看:80
本文介绍了用pdfsharp添加acroform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将带有pdfsharp lib的Acroforms(或任何输入字段)添加到pdf中?例如一个文本框(PdfSharp :: Pdf :: AcroForms :: PdfTextField)我找不到任何示例,只能阅读/修改.

how can i add Acroforms (or any inputfields) with pdfsharp lib to a pdf? For example a textbox (PdfSharp::Pdf::AcroForms::PdfTextField) I can't find any example for this, only read/modify.

我发现"page-> Elements-> Add(key,pdfitem)",但是我无法从PdfSharp :: Pdf :: AcroForms :: PdfTextField或其他表单(无构造函数)创建对象

I found "page->Elements->Add(key,pdfitem)", but i cant create a Object from PdfSharp::Pdf::AcroForms::PdfTextField or the others Forms (no Constructor)

推荐答案

不知道它是否仍然相关(也许与其他用户相关),但是不幸的是,使用PDF Sharp不能做到这一点,就好像它也具有该功能一样,它本来会是一个非常不错的圆形库.该库的AcroFrom功能仅允许定位已存在的库.

Don't know if it is still relevant (maybe it will be relevant for other users), but it is not possible to do that with PDF Sharp, unfortunately, as if it would have had that functionality as well, it would have been a really nice rounded library. The AcroFrom functionality of the library only allows targeting already existing one.

根据您要使用的项目,可以使用iText Sharp,但是它具有不理想的AGPL许可证,还有其他库,但是它们非常昂贵.如果它是一个小的pdf文件(不到10页),则可以使用SpirePDF库中的免费层.

Depending on what is your project for you can use iText sharp, but it has an AGPL license which is not ideal, there are other libraries but they are quite expensive. If it is a small pdf file (under 10 pages) you can use the free tier from the SpirePDF library.

此外,还有一个PDFClown库是开源的(只要您提到您在某处使用过它),但是与PDFSharp类似,它很老,甚至没有PDFSharp记录.

In addition, there is PDFClown library which is open source (as long as you mention that you use it somewhere), but similarly to PDFSharp, it is quite old, and even less documented than PDFSharp.

遗憾的是,没有很多解决方案来解决这个问题.

Sadly, there aren't many solutions to this issue.

这篇关于用pdfsharp添加acroform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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