ImageGear for C and C++ on Windows v19.10 - Updated
AT_PDF_PRINTOPTIONS
API Reference Guide > PDF Component API Reference > PDF Component Structures Reference > AT_PDF_PRINTOPTIONS

This structure provides printing parameters for the IG_PDF_doc_print function.

Declaration:

 
Copy Code
typedef struct tagAT_PDF_PRINTOPTIONS
{
    AT_DWORD size;
    AT_PDF_BOOL emitToFile;
    LPAT_PDF_PRINTPARAMS printParams;
    HIG_PDF_STREAM printStm;
    AT_WORD paperWidth;
    AT_WORD paperHeight;
    AT_DWORD dontEmitListLen; 
    char** dontEmitList; 
    AT_PDF_BOOL emitToPrinter; 
    char* inFileName;
    char* outFileName;
    char* deviceName;
    char* driverName;
    char* portName;
    DEVMODE* pDevMode;
    int startPage;
    int endPage;
    int shrinkToFit;
    int printAnnots;
    int psLevel;
    int nCopies;
    int binaryOK;
    int emitHalftones;
    int reverse;
    int farEastFontOpt;
    int transQuality;
    int doOPP;
    LPVOID cancelProc;
    LPVOID clientData;
    int startResult;  
    AT_WORD* inFileNameW;
    AT_WORD* outFileNameW;
    AT_WORD* deviceNameW;
    AT_WORD* driverNameW;
    AT_WORD* portNameW;
    DEVMODEW* pDevModeW;
    HDC pDC;
    LPVOID userCallbacks;
    AT_PDF_BOOL forceGDIPrint;
    HDC hDC;
    AT_UINT PPDFeatures;
    AT_UINT ppdFileName;
} AT_PDF_PRINTOPTIONS;
typedef AT_PDF_PRINTOPTIONS FAR* LPAT_PDF_PRINTOPTIONS;
 
Copy Code
 
Copy Code

Members:

Name Type Description
size AT_DWORD Size

emitToFile

AT_PDF_BOOL

Create a PostScript file; must be FALSE for now.

printParams

LPAT_PDF_PRINTPARAMS

AT_PDF_PRINTPARAMS structure. Applies to PostScript file.

printStm

HIG_PDF_STREAM

Writeable HIG_PDF_STREAM that points to file stm or proc stm.

paperWidth

AT_WORD

Width of paper in points.

paperHeight

AT_WORD

Height of paper in points.

dontEmitListLen

AT_DWORD

Number of fonts that should not be downloaded.

dontEmitList

char**

List of fonts (T1, TT, CID) that should not be downloaded.

emitToPrinter

AT_PDF_BOOL

Output PDF file to a PS or non-PS printer; must be TRUE for now.

command

char*

Optional command line arguments, used only if emitToPrinter is true.
Example: "lp" or "lpr"

inFileName

char*

DOCINFO structure -> lpszDocName. Points to a null-terminated string that specifies the name of the document.

outFileName

char*

DOCINFO structure -> lpszOutput. Points to a null-terminated string that specifies the name of an output file. If this pointer is NULL, the output will be sent to the device identified by deviceName, driverName, and portName.

deviceName

char*

Name of device to which to print. Available devices can be found in the Windows Registry at HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Devices. Applies to printer.

driverName

char*

Name of driver. For example, "winspool" Applies to printer.

portName

char*

Name of Port. For example, "Ne00" See registry key for deviceName. Applies to printer.

pDevMode

DEVMODE*

Optional - allows you to pass a DEVMODE structure in if you have one.

If you do not pass in your own DEVMODE structure, the new one will be created by calling OpenPrinter(), DocumentProperties(), and ClosePrinter().

We never call SetPrinter() and have no facility to offer the features provided by SetPrinter() (e.g., pause/resume, deleting jobs, changing printer status, etc.). DocumentProperties() is called only in the case where the client doesn’t provide a DEVMODE.

If you provide your own DEVMODE, you will certainly want to call DocumentProperties() to populate it and/or display the print dialog.

startPage

int

Page to start printing with, 0-based.

endPage

int

Page to end printing on.

shrinkToFit

int

1 turns on shrinkToFit, 0 turns it off.

printAnnots

int

1 turns on printing annots, 0 turns it off.

psLevel

int

PostScript printing only - PostScript level.

nCopies

int

PostScript printing only - number of copies to print.

binaryOK

int

PostScript printing only - 1 turns on binary data, 0 turns it off.

emitHalftones

int

PostScript printing only - 1 turns on emitHalftones, 0 turns it off.

reverse

int

PostScript printing only - 1 reverses print order, 0 does regular order.

farEastFontOpt

int

PostScript printing only.

transQuality

int

Transparency flattening quality - 1 is fastest, 5 is best. Default is 3.

doOPP

int

PostScript printing only - 1 uses Overprint Preview, 0 does not. Default is 0

cancelProc

LPVOID

CancelProc and clientData are optional for emitToFile or emitToPrinter. LPFNIG_PDF_PRINTCANCELPROC callback function.

clientData

LPVOID

Optional data passed to cancelProc. Applies to both PostScript printer and file.

startResult

int

Spooler ID from StartDoc().

inFileNameW

AT_WORD*

Used for the Windows DOCINFO structure (lpszDocName) that points to a NULL-terminated string that specifying the name of the document. In case of printing/exporting to Postscript, this field sets the Title DSC comment in the generated Postscript file. inFileNameW has precedence over the deprecated inFileName. If neither is provided, the Title DSC comment is filled with the name of pdf document.

outFileNameW

AT_WORD*

Used for the Windows DOCINFO structure (lpszOutput). It points to a NULL-terminated string that specifies the name of an output file. If this pointer is NULL, the output will be sent to the device identified by deviceName, driverName, and portName. It applies to a printer.

deviceNameW

AT_WORD*

The name of the device to print to (for example, "Distiller Assistant v3.01"). Available devices can be found in the Windows Registry at HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices. It applies to a printer.

driverNameW

AT_WORD*

The name of the driver (for example, "winspool"). See the registry key for deviceName. It applies to the printer.

portNameW

AT_WORD*

The name of the port (for example, "Ne00"). See the registry key for deviceName. It applies to the printer.

pDevModeW

DEVMODEW*

(Optional) Allows you to pass a DEVMODE structure in if you have one.

If you do not pass in your own DEVMODE structure, one is created by calling OpenPrinter(), DocumentProperties(), and ClosePrinter().

ImageGear never calls SetPrinter() and has no facility to offer the features provided by SetPrinter() (for example, pause/resume, deleting jobs, changing printer status, etc.). DocumentProperties() is called only in the case where the client does not provide a DEVMODE.

If you provide your own DEVMODE, call DocumentProperties() to populate it or display the print dialog box.

pDC

HDC

(Optional) Allows you to pass a DeviceContext structure.

If you do not pass in your own DeviceContext structure, PDFL creates its own.

userCallbacks

LPVOID

Unused. Set to 0.

forceGDIPrint

AT_PDF_BOOL

Optional value used for Postscript printing that allows printing with the code path used by the non-ps printer instead of the code used by the PS printer.

hDC

HDC

Optional device handle used to allow the device handle used in the user's sample with StartDoc and EndDoc to be passed to the library to be used in StartPage and EndPage.

PPDFeatures

AT_UINT

Unused. Set to 0.

ppdFileName

AT_UINT

Unused. Set to 0.

Remarks:

To print, set printing method to printer, and fill in inFileName, outFileName, deviceName, driverName, portName, dpi, nCopies, startPage, endPage, psLevel, shrinkToFit, binaryOK, and emitHalftones.