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 v.DoPDF("NewFileName.html",  DestinationPDFName, sOptions)

Comments are closed.