简体   繁体   English

XPages中的PDF是否不使用iText?

[英]PDF in XPages without using iText?

I am trying to make a PDF file. 我正在尝试制作PDF文件。 And also the notes documents are the contents. 注释文件也是其中的内容。 I have a clear idea with iText. 我对iText有一个清晰的主意。

But is there any other solution for making PDFs without using iText? 但是,还有其他不使用iText制作PDF的解决方案吗?

Apache FOP using XSL:FO is a way you can generate PDF (and other formats) from XPages. 使用XSL:FO的Apache FOP是从XPages生成PDF(和其他格式)的一种方式。 I'm in the process to write an article series on my blog detailing my approach and solution. 我正在博客上写一篇文章系列 ,详细介绍我的方法和解决方案。 Ultimately, once I got the spare time, I'll bundle all up and release it on OpenNTF 最终,一旦我有空余时间,我将全部打包并在OpenNTF上发布

You can give Apache PDFBOX a try. 您可以尝试使用Apache PDFBOX I used it to export text contents and it worked just fine. 我用它来导出文本内容,并且效果很好。 Also it is available under Apache license so it can be used in proprietary software unlike iText which is available under Afero GPL which is restrictive than Apache license. 此外,它还可以通过Apache许可获得,因此可以在专有软件中使用,而不像iText可以在Afero GPL下获得,而iText的使用范围比Apache许可要严格。 On the downside Apache PDFBOX is less mature than iText so it has less features and documentation available. 不利的一面是,Apache PDFBOX比iText还不成熟,因此它的功能和文档较少。

There is a custom control on openntf that converts data into pdf's. openntf上有一个自定义控件,可将数据转换为pdf。

http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20PDF%20Exporter%20Custom%20Control http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20PDF%20Exporter%20Custom%20Control

Edit: My mistake this also uses iText. 编辑:我的错误,这也使用iText。

I have used the FDF format to populate PDF template forms. 我已使用FDF格式填充PDF模板表单。

Create yourPDFTemplate.pdf and attach it to the database as a file Add a field "Name" to it and when you call the agent it will open the PDF file and fill the field with MarkyRoden 创建yourPDFTemplate.pdf并将其作为文件附加到数据库中添加一个字段“名称”,当您调用代理时,它将打开PDF文件并用MarkyRoden填充该字段

This is the lotusscript equivalent which could just as easily be done as an xAgent if you wanted to. 这是等效于Lotusscript的,如果您愿意,可以像xAgent一样轻松地完成。 If anyone wants me to I can create an example easily enough. 如果有人要我这样做,我可以很容易地创建一个例子。 Replace "MarkyRoden" with data from a notesdocument 用Notes文档中的数据替换“ MarkyRoden”

Dim session As New NotesSession 昏暗的会话作为新的NotesSession

Print |Content-type: application/vnd.fdf|
Print |%FDF-1.2|
Print |1 0 obj <<|
Print |/FDF <<|
Print |/Fields|
Print |[|
Print |<< /T (Name) /V (MarkyRoden) >>|
Print |]|
Print |/F (http://yourserver.com/mark/testing.nsf/yourPDFTemplate.pdf)|
Print |>>|
Print |>>|
Print |endobj|
Print |trailer|
Print |<< /Root 1 0 R >>|
Print |%%EOF|

End Sub 结束子

PD4ML是一个选项,具体取决于您要执行的操作。

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

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