Quartam PDF Library enables LiveCode developers to create PDF documents by script - you create a document; add pages; draw graphics, images and text; finally output the PDF data to a file; and then free up the memory. Below is a simple 'Hello, world!' example to illustrate the basic workflow :
ask file "Save as:" with "demo1.pdf"
if it is empty then exit mouseUp
put it into tFilePath
-- create a new PDF document with default
-- > units = millimeters
-- > page size = A4
-- > orientation = portrait
-- save the document reference for later library calls,
-- then open the document and add an empty page
put qrtPDF_CreateDocument() into tDocRef
-- set the current text style with
-- > textfont = Arial
-- > textstyle = bold
-- > textheight = 18
qrtPDF_SetFont tDocRef, "Arial", "bold", 18
-- write the text in an invisibe box
-- > starting at 40mm from the left edge of the paper, and 10mm from the top
qrtPDF_WriteTextBox tDocRef, 40, 10, "Hello, world!"
-- close the document, save it to a file and remove its data from memory
qrtPDF_SaveDocument tDocRef, tFilePath
With automatic page breaks and callbacks to let you draw page headers and footers, you have all the power at your fingertips to create PDF documents from your LiveCode-based applications.
Make sure to visit the gallery and download the demo version to explore the example scripts.