Easy PDF printing on Mac and Windows
Issue: 8.5 (July/August 2010)
Article Description: No description available.
Article Length (in bytes): 6,127
Starting Page Number: 18
RBD Number: 8505
8505.zip Updated: Monday, July 5, 2010 at 4:44 PM
Related Web Link(s):
Known Limitations: None
Excerpt of article text...
Printing a PDF cross platform has never been an easy job. First, Windows does not ship with anything that can read, render, or print PDF files. Second there is nothing for PDF built into REALbasic so you have to use some third party libraries or applications. Mac OS X has some PDF capabilities, but Preview.app, the main PDF viewer, is not even AppleScriptable. So this article will show you how to print a PDF on both Mac OS X and Windows.
Creating a PDF
First, we need to have an application which creates a PDF. For this we simply take example code that comes with the plugins:
dim pdf as new DynapdfMBS
dim d as new date
dim f as FolderItem=SpecialFolder.Desktop.Child("test.pdf")
call pdf.CreateNewPDF f
call pdf.SetDocInfo pdf.kdiSubject, "My first Realbasic output"
call pdf.SetDocInfo pdf.kdiProducer, "Realbasic test application"
call pdf.SetDocInfo pdf.kdiTitle, "My first Realbasic output"
// We want to use top-down coordinates
call pdf.SetPageCoords pdf.kpcTopDown
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.