pdfPrint Function Usage

  • Your web site mentions a function "pdfPrint" to print a PDF file directly without the need to create an instance of a component. Can you provide an example of how to use this function in Delphi (7). Also, is this function available in the Standard version or do you need the Plus edition?

    Thanks,
    Mark

    • Offizieller Beitrag

    Hi,

    You can use this in the standard version as well.

    You need to define an external function:

    function pdfPrint(filename: PChar; password: PChar;
    licname, lickey: PChar; liccode: Cardinal;
    options: PChar): Integer; stdcall;
    external 'wPDFViewDemo01.dll' name 'pdfPrint';

    This funtion can then be executed in your code to print a PDF file.

    pdfPrint(FileName.Text,
    '', // Password or ""
    '','',0, // License Information
    ''); // Options

    Options are encoded as string list:

    The options string can contain several parameters. They need to be placed in quotes (") and separated by comma sings.

    PRINTER=xxxx - select printer name
    COPIES=n - select count of copies
    COLLATE=1 - enable collate mode LISTPRINTER=1 - list all printer names to debug console
    LISTTRAY=1 - list all tray to debug console
    TRAY1=N - printer tray for first page
    TRAY2=N - printer tray for all pages

    Regards,

    Julian Ziersch