PrintDoc method

The page of the specified document is printed.

Method
short PrintDoc(
  • long Index,
  • long page,
  • char * pPrinterName,
  • boolean LocalPrinter,
  • short Copies,
  • short Orientation,
  • float TopMargin,
  • float BottomMargin,
  • float LeftMargin,
  • float RightMargin,
  • boolean MarginInMillimeters )
Parameters
Index
Specifies the zero-based index of a document within the document list of the active folder. If this value is less than zero, the open document is printed. If a local printer is specified, only the open document can be printed.
page
Specifies the page number to be printed. If this parameter is less than or equal to zero, the entire document is printed. If a server printer is specified, this parameter is ignored and the entire document is printed.
pPrinterName
Points to a null-terminated character string containing the name of a local or server printer. For local printers, the name should be the same as that typically displayed in a printer selection list (for example, IBM® Laser Printer 4019 on LPT1:). For server printers, the name should be one of those defined for the current server in the Content Manager OnDemand database.
LocalPrinter
If nonzero, indicates that the name specified for pPrinterName is a local printer; if zero, that it specifies a server printer. If local, only the open document can be printed. If server, the orientation and margin values are ignored and the entire document is printed.
Copies
Specifies the number of copies to be printed. This value must be between 1 and 100.
Orientation
Specifies the page orientation. This must be one of the following orientation values found in ARSOLEEX.H:
  ARS_OLE_ORIENTATION_PORTRAIT
  ARS_OLE_ORIENTATION_LANDSCAPE
  ARS_OLE_ORIENTATION_BEST_FIT
  ARS_OLE_ORIENTATION_ASIS
This parameter is ignored if a server printer is specified.
TopMargin
Specifies the amount of space for the top page margin. This parameter is ignored if a server printer is specified.
BottomMargin
Specifies the amount of space for the bottom page margin. This parameter is ignored if a server printer is specified.
LeftMargin
Specifies the amount of space for the left page margin. This parameter is ignored if a server printer is specified.
RightMargin
Specifies the amount of space for the right page margin. This parameter is ignored if a server printer is specified.
MarginsInMillimeters
If nonzero, indicates that the margin values are specified in millimeters; if zero, that they are specified in inches. This parameter is ignored if a server printer is specified.
Description
The page of the specified document is printed.
Return Value
Refer to return codes.
See Also
GetNumDocsInList, and OpenDoc methods

C/C + +

The following example prints page 5 of the open document on a local printer.
 CArsOle * pArsCtrl;
 short rc;
   .
   .
 rc = pArsCtrl->PrintDoc( -1,
                          5,
                          "Acrobat PDFWriter on DISK:",
                          TRUE,
                          1,
                          ARS_OLE_ORIENTATION_BEST_FIT,
                          0.5,
                          0.5,
                          0.5,
                          0.5,
                          FALSE );

 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;
   .
   .

Visual Basic

Dim rc As Integer

 .
 .

rc = ArsOle.PrintDoc (-1,                           _
                      5,                            _
                      "Acrobat PDFWriter on DISK:", _
                      True,                         _
                      1,                            _
                      ARS_OLE_ORIENTATION_BEST_FIT, _
                      0.5,                          _
                      0.5,                          _
                      0.5,                          _
                      0.5,                          _
                      False)
If rc <> ARS_OLE_RC_SUCCESS Then
   MsgBox "ERROR"
   End
End If

 .
 .