PDF Converter for Notes
DocsSupport RequestWebsite
  • PDF Converter for Notes
  • Installation / uninstallation
    • Installing and activating
      • Installing PDF Converter toolbar icon
      • Installing PDF Converter toolbar icon for multiple users
      • Installing PDF Converter on server for automated archiving
      • Installing PDF Converter on Linux server
      • Offline license activation
      • PDF Converter sample on web
      • System Requirements
    • Uninstalling
      • Removing the PDF Converter toolbar icon
      • Removing the PDF Converter toolbar icon for multiple users
      • Removing PDF Converter completely from your system
    • Upgrading
      • Upgrade PDF Converter to a new release
      • Upgrade PDF Converter design elements in a custom application
    • Release History
  • Getting started
    • PDF Converter terminology
      • PDF package
      • PDF attachments
      • Separate PDF files
      • Flat vs. structured document export
      • Single PDF file with a bookmark view
      • Alternate Notes forms
      • Archiving jobs
    • Screencasts
    • Settings
      • General Settings
      • PDF Settings
      • Toolbar Icon Settings
    • Converting client-side
      • How to export emails to a PDF package
      • How to append emails to a PDF package
      • How to export emails to multiple PDFs
      • How to export mail folders to PDF
      • How to export view categories to PDF
      • How to export all emails to PDF
      • How to export parent-child documents
      • How to manage PDF document settings
      • How to export Notes metadata
      • How to export documents to PDF/A format
      • How to convert attachments to PDF
      • How to export attachments to disk
      • How to set PDF headers and footers
      • How to reduce PDF file size
      • How to use alternate forms
      • How to create a naming rule for the PDFs
      • Summary of export options
    • Converting server-side
      • How to export multiple databases to hard disk
      • How to schedule Notes email export to PDF
      • How to export a custom/programmatic document selection
      • How to export Notes metadata
      • How to classify PDF records using folders
      • How to run post-processing tasks on the PDF files
      • How to apply PDF settings to an archiving job
  • How to...
    • How to use the conversion dialog
    • How to set up a custom naming convention for PDF files
    • How to add header and footer to a PDF document
    • Using alternate forms
    • How to convert a document collection using multiple alternate forms
    • How to convert password protected HTML content
    • How to disable HTTP stream
    • How to enable international characters
    • How to enable/disable the low-level renderer
    • How to export documents ordered as in Lotus Notes view
    • How to find your Notes Installation and Notes Data directories
    • How to enable single category export using high level renderer [embedded views]
    • How to manually activate an API enabled database
    • How to reduce the PDF file size
    • How to search a PDF package
    • How to search PDF attachments
    • How to see your PDF Converter version number
    • How to send error-prone documents/emails to the Support
    • How to set custom PDF settings from LotusScript
    • How to use alternate forms in an archiving job
    • How to set PDF security
    • How to have working doclinks in PDF files
  • Tips / miscellaneous
    • About PDF metadata
    • Are Notes document links supported?
    • Types of output
    • Attachment options
    • Can I export OLE objects to PDF?
    • Deployment check-list
    • Disabling access for non-administrators
    • Do I need to have the latest JRE (Java Runtime Environment) installed on my Workstation/Server?
    • Exporting large sets of documents/emails using the toolbar icon
    • Extracting ZIP archive files
    • How to enable Microsoft Office conversion on Domino server
    • How to enable PDF search in Windows (64-bit)
    • How to get the SharePoint repository ID
    • Java files (jar) list
    • Merging attachments with PDF forms
    • PDF filename Unicode compliance tips
    • PDF/A format description
    • Product limitations
    • Single-Click Exports
    • There's no "Show Java Debug Console" option in my Lotus Notes client
    • What is the SWING PDF Converter installation footprint?
    • Where can I find my attachments?
    • Which view/folder types are supported
  • For developers
    • Enabling your applications
    • API Design elements description
    • LotusScript API reference
      • Class SwPDFDocument
        • Public Function AppendTo(DestFilePath As String)
        • Public Function GetAsRTItem() As NotesRichTextItem
        • Public Function GetAsRTItemEx(attachmentName As String) As NotesRichTextItem
        • Public Function GetFilePath()
        • Public Function GetMetadata() as String
        • Public Function IsCollection() As Boolean
        • Public Function Recycle()
        • Public Function SaveToFile(FilePath As String)
      • Class SwPDFCreator
        • Public Function GetError() As SwPDFError
        • Public Function GetVersion() As String
        • Public Function Init(LicenseKey As String) As Boolean
        • Public Function InitWithActivationResponse(ActivationResponse As String) As Boolean
        • Public Function LoadSettingsFromUNID(PDFSettingsUNID As String, UseGeneralSettings As Boolean) As Bo
        • Public Function ProcessDocCollection(dc As NotesDocumentCollection, DbView As String) As SwPDFDocume
        • Public Function ProcessDocCollectionFromFile(FilePath As String, DbServer As String, DbPath As Strin
        • Public Function ProcessDocument(doc As NotesDocument) As SwPDFDocument
        • Public Function ProcessFolders(dbSrc As NotesDatabase, FoldersList As Variant, IncludeResponses As B
        • Public Function ProcessRTItem(rtItemSource As NotesRichTextItem) As SwPDFDocument
        • Public Function ProcessUrl(url As String) As SwPDFDocument
        • Public Function ProcessViewCategories(view As NotesView, CatList As Variant, IncludeResponses As Boo
        • Public Function SetPdfProperties(Title As String, Subject As String, Author As String, Keywords As S
        • Public Function SetWatermarkFont(fontFamily As String, size As Integer, style As Integer, colorR As
        • Public Function SetWatermarkImage(filePath As String, position As Integer, margin As Double) - Learn
        • Public Function SetWatermarkText(wmText As String, rotation As Double, position As Integer, margin A
      • Class SwPDFSettings
        • Public Function SetHTTPProxy(proxyHost As String, proxyPort As Integer)
        • Public Function SetCustomMetadata(CustomMetadata As Variant, CustomMetadataOnly As Boolean) As Boole
      • Class SwPDFRegistration
        • Public Function GetVersion() As String
        • Public Function GetLicense() As SwPDFLicense
        • Public Function Register(LicenseKey As String) As Variant
      • Class SwPDFLicense
      • Class SwPDFProgress
        • Public Function GetCurrentIndex() As Integer
        • Public Function GetStatus() As Integer
      • Class SwPDFError
    • LotusScript code samples
      • Button on form
      • Button on view
      • Add metadata
      • Add custom header/footer to PDF document
      • PDF conversion on the Web
      • Convert large number of documents
      • Change document orientation
      • Convert single document from UI
      • Doclinks sample for repository
      • View to PDF package
  • Troubleshooting
    • Troubleshooting Guide
    • Error messages
      • Error - Type mismatch in method OP_CHECK_TOS_INST AINSTANCE found, Unknown expected
      • Error - Cannot write or create file (file or disk is read-only)
      • Error - DLL issue on 64-bit servers
      • Error - Domino HTTP Error Loading Java Virtual Machine
      • Error - Exception in thread "Launcher: SwCreatePDF" java.lang.NoClassDefFoundError: -SOME CLASS-
      • Error - ExceptionConverter: java.security.NoSuchAlgorithmException
      • Error - INITIALIZE ERROR: EXTRACTJAVARESOURCES (nn) : 91 - Object variable not set - INIT (nn) - Lea
      • Error - java.security.AccessControlException: Access denied ([SOME CLASS EXCEPTION]) - Learning Cent
      • Error - ReferenceError: openLInkPriv is not defined
      • Error - swllrend.dll corrupted or not extracted
      • Error - SWPDFSAVETODISK (29) : 53 - File not found
      • Error - There is another PDF conversion process already started
      • Error - Type mismatch (13)
    • General issues
      • Archiving jobs agent timeout
      • Concurrent execution issues
      • Conversion speed is slow
      • Document links not working
      • Email images do not appear in PDF
      • Header and footer not visible in my emails
      • Header and footer not visible or partially visible
      • How to enable SWING PDF Converter with Symantec Endpoint Protection (SEP)
      • Numerous "Trust to..." prompts appearing
      • PDF toolbar icon does not appear after installation
      • PDF toolbar icon not shown in IBM Notes 9 toolbar
      • PDF toolbar icon is still on my toolbar after uninstalling
      • Select categories / folders applet is failing to start
      • ZIP files can not be detached from PDF
      • PDF fonts not embedded for Asian/Arabic documents
      • Thai symbols not shown in PDF document
    • History log
      • Archiving job logs
      • Conversion and error logs
      • Notes crashes during conversion
  • Seascape for Notes
  • Support
    • Support Request
    • Premium Export Services
Powered by GitBook
On this page
  • How it works
  • Sample code
  • About "Pass-Thru HTML"

Was this helpful?

  1. For developers
  2. LotusScript code samples

PDF conversion on the Web

PreviousAdd custom header/footer to PDF documentNextConvert large number of documents

Last updated 3 years ago

Was this helpful?

To preview the PDF Converter's web functionality follow these simple steps:

  • Copy SWING PDF Converter database (PDFConverter.nsf) to your server.

  • Open Domino Administrator, navigate to PDFConverter.nsf and sign the application with Active Server's ID.

  • Open PDFConverter.nsf in Lotus Notes and enter your serial key.

  • In Application properties (5th tab) set "When opened in browser: Open designated Frameset" -> "Frameset: MainWeb".

  • Open the application in your web browser and click the Create PDF button.

  • PDF Converter will now extract all required files. Please restart your Domino server to complete installation.

  • You should be able to use PDF Converter on the web now

How it works

SWING PDF Converter web example UI form is stored in Swing PDF Converter database, in "FaxWeb" form. Back end code is in the "FaxWeb" agent.

Here's a brief explanation how web conversion works: Form "FaxWeb" is a Notes form that is optimized for web display.

When user clicks on the button "Create PDF", simple formula code that saves the document and closes window is executed: @Command([FileSave]); @Command([FileCloseWindow])

There is an event trigger defined which executes when the document is being saved ("WebQuerySave" event): @Command([ToolsRunMacro];"FaxWeb") This event executes LotusScript agent "FaxWeb".

Agent "FaxWeb" initializes Swing PDF Converter, converts the document and constructs output HTML from PDF document path.

This HTML code is printed to the clients browser.

Sample code

Here's the "FaxWeb" agent source code:

Option Public
Option Declare
Use "SwPDFMain"
Sub Initialize
    Dim s As New NotesSession, docContext As NotesDocument
    Dim swPDF As New SwPDFCreator, swPDFDoc As SwPDFDocument, pdfErr As SwPDFError
    Dim rtitem As NotesRichTextItem, PDFFileName As String, HrefUrl As String
	
    PDFFileName = "test.pdf"
	
    Set docContext = s.DocumentContext
    If Not docContext Is Nothing Then
	If swPDF.Init("") Then
            ' Set alternate form and default file name used for PDF conversion
	    swPDF.PDFSettings.AlternateForm = "Fax"
	    swPDF.PDFSettings.IncludeWebAttachments = True
			
	    swPDF.FileName = PDFFileName
	    ' enable font embedding for non ascii characters
	    swPDF.PDFSettings.EnableFontEmbedding = True
	    'enable console logging
	    swPDF.PDFSettings.ConsoleLogging = True
	    ' Convert doc to PDF
	    Set swPDFDoc = swPDF.ProcessDocument(docContext)
			
	    If Not swPDFDoc Is Nothing Then
		' Finally, get generated PDF as RTItem and store it in document for further reference
		Set rtitem = swPDFDoc.GetAsRTItem()
	    	Call rtitem.CopyItemToDocument(docContext, "")
		Call docContext.Save(True, True)
				
		Call swPDFDoc.Recycle()
				
		' Construst a URL and display generated PDF in a web browser
		HrefUrl = "0/" & Cstr(docContext.UniversalID) & "/$File/" & PDFFileName
		Print |You can download a copy of PDF file from here
 | & Chr$(13) & ||
	    Else
		' There was an error in PDF conversion
		Set pdfErr = swPDF.GetError()
		Print "ERROR: " & pdfErr.Message & ""
	    End If
        Else
	    ' There was an error in PDF initialization
	    Set pdfErr = swPDF.GetError()
	    Print "ERROR: " & pdfErr.Message & ""
        End If
    End If
End Sub

About "Pass-Thru HTML"

SWING PDF Converter does not support "Pass-Thru HTML" content on Lotus forms.

Rendering those forms to PDF will result in PDF document showing the plan HTML/JavaScript source code.

To work around this issue you may design an alternate Notes form that shows the same content but without using HTML.

More on alternate forms:

How to use alternate forms
Using alternate forms