Using A Notes Agent To Create PDF Content

DominoPDF can convert any HTML content to PDF, no matter where it originates, however if client-side usage is needed and HTTP / HTTPS / URLs are not available an agent can be used to generate the appropriate output.

LotusScript can be used to write document values, layout, formatting etc. to a local / temporary HTML file which is then passed to DominoPDF.

For example;

Sub Initialize
Dim fileNum As Integer
Dim fileName As String
Dim oDoc as NotesDocument

fileNum% = Freefile()
fileName$ = “c:\data.html”

Open fileName$ For Output As fileNum%
Print #fileNum%, |<html>|
Print #fileNum%, |<body>|
Print #fileNum%, |<p>|
Print #fileNum%, oDoc.Subject(0)
Print #fileNum%, |</p>|
Print #fileNum%, |</body>|
Print #fileNum%, |</html>|

Close fileNum%

Call v.DoPDF(|c:\data.html|, |c:\data.pdf|, ||)
End Sub

A number of our customers have taken this strategy further by building reports, invoices and custom layouts for generating PDF output.

By using a LotusScript agent to generate custom HTML you have full control over your PDF.

Comments are closed.