简体   繁体   中英

PDF in XPages without using iText?

I am trying to make a PDF file. And also the notes documents are the contents. I have a clear idea with iText.

But is there any other solution for making PDFs without using iText?

Apache FOP using XSL:FO is a way you can generate PDF (and other formats) from XPages. 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

You can give Apache PDFBOX a try. 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. On the downside Apache PDFBOX is less mature than iText so it has less features and documentation available.

There is a custom control on openntf that converts data into pdf's.

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

Edit: My mistake this also uses iText.

I have used the FDF format to populate PDF template forms.

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

This is the lotusscript equivalent which could just as easily be done as an xAgent if you wanted to. If anyone wants me to I can create an example easily enough. Replace "MarkyRoden" with data from a notesdocument

Dim session As New 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是一个选项,具体取决于您要执行的操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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