PocketPixPrint Command Line
Support
PocketPixPrint supports parameter passing through the
command-line to allow Pocket PC applications to use PocketPixPrint
for printing images and pages of thumbnail images behind the
scenes. Any or all of the following parameters may be passed via
command-line.
Supported command-line parameters are:
Single Image Printing:
/IFpath - Image file path to print
/ISx - Print Size : 0=Exact, 1=Fit to Page, 2=Custom
Size (default: 0)
/IHx - Horizontal posn: 0=Left, 1=horiz center,
2=right (default 1)
/IVx - Vertical posn: 0=Top, 1=vertical center,
2=bottom (default 1)
Single Image Custom Print Size
settings:
/CPx - Maintain proportions/Aspect ration: 0=FALSE, 1=TRUE
(default: 0)
/CWx - Custom Width in locale units -inches or cm
(default: 5.0 inches)
/CHx - Custom height in locale units (default 3.0 inches)
Thumbnail Printing:
/TFpath - Path to folder containing thumbnail images to print
/TAx - Thumbnail images across+1 (0-9) -> 1-10
(default: 4)
/TDx - Thumbnail images down+1 (0-9) -> 1-10
(default: 6)
/EJ - Exclude JPG files
/EB - Exclude BMP files
/EG - Exclude GIF files
/EP - Exclude PNG files
Filename & Font (shared
by Single Image & Thumbnail):
/FTx - Print file names : 0=NO, 1=YES (default: 1)
/FNfontname - Font name to use (default: Tahoma)
/FSx - Point size of font (default: 12pt for single image,
8pt for thumbnail)
Misc. Settings (shared
by Single Image & Thumbnail):
/Bx - Brightness setting: 0=darkest, 9=lightest (default: 4)
/E - Extended error return (see Return Values discussion
below)
/Rregcode - Developer's registration code
/SS - Skip Single Image/Thumbnail setup dialog
/SP - Skip Printer Selection dialog
Return Values: Use the "GetExitCodeProcess()"
function (see example below) to determine if PrintPocketCE was
successful in printing. Normally returns 0 for Error or 1 for
Success. If /E option (extended error code) is passed in
command-line, then GetExitCodeProcess() returns error codes
equivalent to those returned by GetLastError() function, including
the following:
Example: the following is C code that uses
CreateProcess() to invoke PocketPixPrint to print the image file "Apples.jpg"
in the \My Documents\Photos folder. Specify Custom size of 6.0
inches wide by 4.0 inches high while maintaining the images
proportions (aspect ratio).
PROCESS_INFORMATION pi;
//Start up PocketPixPrint - filename and set QuickPrint
mode
bval=CreateProcess(_T("\\Windows\\Start Menu\\Programs\\PocketPixPrint.exe"),
_T("/IF \\My
Documents\\Photos\\Apples.jpg /IS2 /CP /CW6.0 /CH4.0"),
NULL,NULL,FALSE,0, NULL, NULL, NULL, &pi);
if (bval==0) {
//Error starting PocketPixPrint
dval=GetLastError();
}
else {
// Lets wait until PocketPixPrint finishes printing
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
//PocketPixPrint is done... lets see
if it was successful
DWORD dwExit;
GetExitCodeProcess(pi.hProcess, &dwExit);
if (dwExit==0) {
//Handle
error
}
CloseHandle(pi.hProcess);
}