Name of print job in WPViewPDF. PrintPages?

  • How can I specify a name for my print job?

    This is my code:
    ...
    with PrintDialog1 do begin
    PrintDialog1.MinPage := 1;
    PrintDialog1.MaxPage := WPViewPDF1.PageCount;
    PrintDialog1.FromPage := 1;
    PrintDialog1.ToPage := WPViewPDF1.PageCount;
    if execute then
    if Printer.PrinterIndex > -1 then begin
    WPViewPDF1.BeginPrint(Printer.Printers[Printer.PrinterIndex]);
    // HOW TO ADD NAME FOR PRINTJOB ???
    WPViewPDF1.PrintPages(PrintDialog1.FromPage, PrintDialog1.ToPage);
    WPViewPDF1.EndPrint;
    end;
    end; // with PrintDialog1 do

    Cheers
    Christoph

    • Offizieller Beitrag

    Hi,

    In unit WPViewPDF1.pas right now this method is used.

    Code
    function TWPViewPDF.BeginPrint(Printername: string): Boolean;begin  if Printername <> '' then    CommandStr(COMPDF_SelectPrinter, Printername);  Result := Command(COMPDF_BeginPrint) > 0;end;

    If you change it to

    Code
    function TWPViewPDF.BeginPrint(Printername: string; Jobname : string = ''): Boolean;
    begin
      if Printername <> '' then
        CommandStr(COMPDF_SelectPrinter, Printername);
      Result := CommandStr(COMPDF_BeginPrint, Jobname) > 0;
    end;

    You can optionally pass a job name. (Will be also in next release)

    Kind Regards,

    Julian