PrintDocumentToFile

レンダリングと印刷

説明

選択したドキュメントの特定のページを指定したプリンターにレンダリングします。印刷出力は指定したスプールファイルに送られます

すべてのプリンタードライバーが DocInfo.lpszOutput フィールドに対応しているわけではないため、結果が異なる場合があります

構文

Delphi

Function TPDFlib.PrintDocumentToFile(Const PrinterName: WideString; StartPage, EndPage, Options: Integer; Const FileName: WideString): Integer;

ActiveX

Function PDFlib::PrintDocumentToFile(PrinterName As String, StartPage As Long, EndPage As Long, Options As Long, FileName As String) As Long

DLL

int DLPrintDocumentToFile(int InstanceID, const wchar_t* PrinterName, int StartPage, int EndPage, int Options, const wchar_t* FileName);
int DLPrintDocumentToFileA(int InstanceID, const char* PrinterName, int StartPage, int EndPage, int Options, const char* FileName);

パラメータ

PrinterName印刷に使用するプリンター名。これは Windows Print Manager に表示される名前である。GetPrinterNames 関数を使用してシステム上の有効なプリンター一覧を取得する。NewCustomPrinter 関数が返す値もここで使用できる
StartPage印刷する最初のページ
EndPage印刷する最終ページ
Optionsこのパラメーターの値を取得するには PrintOptions 関数を使用します
FileName印刷出力をスプールするファイル名

戻り値

出力をスプールファイルへリダイレクトして印刷ジョブを送信できた場合は1を返します。プリンター名が無効な場合や、印刷ジョブが失敗またはキャンセルされた場合は0を返します。