easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

OfficePreference Property

Gets/Sets the Office to PDF conversion preferences.

prnOfficePreference OfficePreference { get; set; }

Property OfficePreference As prnOfficePreference

def getOfficePreference(self)
def setOfficePreference(self, value)

prnOfficePreference getOfficePreference() throws PrinterException
void setOfficePreference(prnOfficePreference value) throws PrinterException

function getOfficePreference() 
function setOfficePreference($value) 

BclPrnResult GetOfficePreference(BclPrinter* pPrinter,
                                 BclPrnOfficePreference* poutVal);
BclPrnResult SetOfficePreference(BclPrinter* pPrinter,
                                 BclPrnOfficePreference newVal);
Property OfficePreference As prnOfficePreference



Default Value

PRN_MSOFFICE_DIRECT_PRINT (for compatibility with easyPDF SDK 6.x)


Printer.PrintJob is the central dispatcher in the Printer SDK. It automatically detects the type of the document and forwards it to a specific print job implementation.

Originally PrintJob was fairly straightforward. For .DOC and .TXT, it used WordPrintJob. For .XLS, it chose ExcelPrintJob. For .HTML, it dispatched to IEPrintJob.

However, over time the Printer SDK grew to the point that most Office documents can be converted to PDF in multiple different ways. For example:

It makes sense to set this preference in PrintJob, which is exactly why OfficePreference exists. The following choices are valid:

Note that for Outlook documents there are no choices, it is always OutlookPrintJob. However, when OutlookPrintJob prints its attachments, it considers the OutlookPrintJob.OfficePreference and OutlookPrintJob.WebBrowserPreference properties. For example, a DOC file attached to an Outlook message can be printed in different ways.

Example Usage

Set oPrinter = CreateObject("easyPDF.Printer.8")
Set oPrintJob = oPrinter.PrintJob

oPrintJob.OfficePreference = PRN_MSOFFICE_EXTENDED_PRINT
oPrintJob.PrintOut "C:\test\input1.doc", "C:\test\output1.pdf" ' Same as WordPrintJobEx
oPrintJob.PrintOut "C:\test\input2.xls", "C:\test\output2.pdf" ' Same as ExcelPrintJobEx

oPrintJob.OfficePreference = PRN_OPENOFFICE_NATIVE_PDF
oPrintJob.PrintOut "C:\test\input3.doc", "C:\test\output3.pdf" ' Same as OpenOfficePrintJob

oPrintJob.OfficePreference = PRN_MSOFFICE_EXTENDED_PRINT
oPrintJob.PrintOut "C:\test\input4.msg", "C:\test\output4.pdf" ' Same as OutlookPrintJob, but .DOC attachments
                                                               ' are printed via WordPrintJobEx