Need help or advice?

Call us on
+44 (0) 2077 545 948

PDF Notes

Notes To PDF

Quickly and easily convert Notes to PDF. With only 2 lines of code any Notes / Domino content can be saved as PDF.

Download Now
How To Resize Images When Converting To PDF

We have a customer who operates in the insurance industry and needed to convert large dimension images to PDF.

By default DominoPDF would split the large image over a number of pages to ensure the content could be seen, however the customer wanted to resize the image to fit onto a single page.

Their developer kindly provided the LotusScript code they used to achieve this and we reproduce it below.

Step 1: Create a sub to print the data to a given HTML file

Sub printToFile(sFileName As String, sData As String)
	Dim fileNum As Integer
	fileNum% = Freefile()
	Open sFileName For Output As fileNum%
	Print #fileNum%, sData
	Close fileNum%
End Sub

Step 2: Build the HTML data string to pass to the above routine

htmldata = |<html><body><img src=| & ImageFileName & | width="1200" 
height="900"></body></html>|

Step 3: Pass the stripped out filename to create an HTML file with the same name as the image.

Call printToFile("NewFileName.html", htmldata)

Step 4: Call the DoPDF function

Call DoPDF("NewFileName.html", 
DestinationPDFName, sOptions)

Comments (0)add
Write comment
smaller | bigger

busy
 

News Feed

Subscribe to the Primeapple RSS News Feed.