Home

Printing Utilities
  PrintPocketCE
  -FAQ
  -Print Options
  -Command-Line Use
  PIEprint
  PocketPixPrint
  PocketShot
  PocketClipPrint
   + + + + +

Software Developers
  PrinterCE SDK
 
PrinterCE.NetCF SDK
  PocketHTMLprint SDK

Special Topics
  Supported Printers
  Bluetooth Printing
  Network Printing

Arcade Games
  SockOut
  MazeCraze

Contact Info

PrintPocketCE Command Line Support
Special Developer License Pricing

PrintPocketCE can be used with eVC's CreateProcess() command-line support method allow Pocket PC applications to use PrintPocketCE for printing Pocket Word, RTF and plain text files behind the scenes. Direct email printing from the command-line is not currently supported. Any or all of the following parameters may be passed via command-line. Note: eVB does not offer a CreateProcess() method for command line support.

Supported command-line parameters are:

/F<filename> - Passes full path and file name of document to be printed - this parameter must be a Pocket Word, Rich Text or plain text file.

/Q - Specifies "QuickPrint" to bypass Select Printer dialog

/P - Specifies "Plain Text" to print out Pocket Word and RTF using plain text

/R<registration code> - Passes PrintPocketCE registration code to enable PrintPocketCE to print in full non-evaluation mode. 

/E - Returns extended error codes (see Return Values discussion below)

/I - Forces PrintPocketCE to start with Inbox Email display list.

/W - Forces PrintPocketCE to start with Word/Doc display list.

------------------ Pocket Excel Options ----------------

/A<filename> - Passes full path and file name of Pocket Excel (PXL) spreadsheet to be printed.

/X - Forces PrintPocketCE to start with Pocket Excel display

/XAn - Excel Print Area: 0="Full Spreadsheet", 1="Selection", 2="Populated", 3="Custom"

/XAFn - Custom print area "From" cell

/XATn - Custom print area "To" cell

/XSn - Sheet to print (0-9)

/XZn - Print Sizing: 0="Normal - 100%", 1="Fit to Page", 2="Custom"

/XZCn - Print sizing Custom percentage : 25 - 250 (%)

/XHn - Include Row & Column headings (1=TRUE, 0=FALSE)

/XGn - Include gridlines (1=TRUE, 0=FALSE)

/XBn - Include background colors (1=TRUE, 0=FALSE)

/XCn - Center spreadsheet (1=TRUE, 0=FALSE)

/XQ - Skip Excel options screen (Note: Use /XQ and /Q to skip all setup dialogs. /XQ can be used without /Q but if /XQ is not used, /Q will be ignored, since user can select quick print at Excel options screen.

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:

bullet

ERROR_SUCCESS

bullet

ERROR_INVALID_FUNCTION

bullet

ERROR_OPERATION_ABORTED

bullet

ERROR_FILE_NOT_FOUND

bullet

ERROR_PRINT_CANCELLED

Example: the following is C code that uses CreateProcess() to invoke PrintPocketCE to print out the document "ActiveSync EULA.psw". The /Q parameter specifies QuickPrint mode to go directly to printing.

  PROCESS_INFORMATION pi;
  //Start up PrintPocketCE and pass filename and set QuickPrint mode
  bval=CreateProcess(
       _T("\\Program Files\\PrintPocketCE\\PrintPocketCE.exe"),
        _T("/Q /F \\My Documents\\Hello.psw"), 
        NULL,NULL,FALSE,0, NULL, NULL, NULL, &pi);
  if (bval==0) {
      //Error starting PrintPocketCE
      dval=GetLastError();
  }
  else {
      // Lets wait until PrintPocketCE finishes printing
      CloseHandle(pi.hThread);
      WaitForSingleObject(pi.hProcess, INFINITE);
      //PrintPocketCE is done... lets see if it was successful
      DWORD dwExit;
      GetExitCodeProcess(pi.hProcess, &dwExit);
      if (dwExit==0) {
          //Handle error
      }
      CloseHandle(pi.hProcess);
  }

If you wanted to print a Pocket Excel spreadsheet, you could replace the CreateProcess call above with the following:

 bval=CreateProcess(
    _T("\\Program Files\\PrintPocketCE\\PrintPocketCE.exe"),
    _T("/Q /XQ /XA0 /XS0 /XZ1 /XH1 /XG0 /XB1 /XC1 
         /A \\My Documents\\Invoice.pxl"), 
        NULL,NULL,FALSE,0, NULL, NULL, NULL, &pi);

Special Developer Pricing for PrintPocketCE: If you wish to use PrintPocketCE from within your own Pocket PC application using the Command-Line support, you can purchase a Developer License below. The two primary limitations on PrintPocketCE Developer Licenses:
  1. Your application may not directly compete with PrintPocketCE or have, as its primary purpose, the ability to select and print general Pocket Word, Rich Text, plain text or any other file types supported by PrintPocketCE.
  2. Your application must use the /R parameter to pass your License Key each time it uses PrintPocketCE and this License Key must not be made available to your users. This will allow your users to print from your application without permanently unlocking PrintPocketCE for their own general use on their Pocket PC. If you wish to provide your users with a fully unlocked copy of PrintPocketCE for their own use, you need to purchase the appropriate number of PrintPocketCE user licenses (see user license discounts here).

Read PrintPocketCE Developer License Agreement

For questions or company purchase orders/checks/money orders/wire transfers: sales@fieldsoftware.com


Buy PrintPocketCE Developer's Edition
10 Installations - $200.00

To purchase different number of installations (minimum 10)
: sales@fieldsoftware.com