Printing a to a Specific Printer While Setting Paper Size_orientation... - Grupos de Google

download Printing a  to a Specific Printer While Setting Paper Size_orientation... - Grupos de Google

of 2

Transcript of Printing a to a Specific Printer While Setting Paper Size_orientation... - Grupos de Google

  • 7/25/2019 Printing a PDF File to a Specific Printer While Setting Paper Size_orientation... - Grupos de Google

    1/2

    Grupos de Google

    Printing a PDF File to a specif ic printer while setting paper size/orientation...

    Joe Trapani 20-ene-2009 22:46

    Publicado en el grupo: borland.public.delphi.language.delphi.win32

    I am trying to have my Delphi Win 32 app to print a PDF to

    a printer. If I simply send a ShellExecute to the printer, it comes

    out on a

    8.5x11" sheet of paper, we need these PDF's to be printed on a 11x17"

    sheet, using a landscape orientation.

    I have figured out how to modify the printer settings ...

    Procedure TfrmMain.btnPrint2Click

    ( Sender: TObject );

    Var

    Device,

    Driver, Port : Array[0..255] Of char;

    DeviceMode : THandle;

    DevMode : PDeviceMode;

    Begin

    { Set the printer index to the one we choose }

    Printer.PrinterIndex := lbxPrinters.ItemIndex;

    With Printer Do Begin

    GetPrinter (Device, Driver, Port, DeviceMode);

    { LOCK }

    DevMode := GlobalLock (Devicemode);

    With DevMode^ Do Begin

    dmFields := dmFields Or DM_ORIENTATION;

    dmOrientation := DMORIENT_LANDSCAPE;

    dmPaperSize := DMPAPER_11X17;

    End;

    BeginDoc;

    Try

    Canvas.Font.Size := 20;

    Canvas.Font.Name := 'Arial';

    Canvas.TextOut (50, 50, 'This is landscape');

    { UNLOCK }

    GlobalUnlock (DeviceMode);

    Finally

    ng a PDF File to a specific printer while setting paper size/orientatio... https://groups.google.com/forum/print/msg/borland.public.delph

    2 14-01-20

  • 7/25/2019 Printing a PDF File to a Specific Printer While Setting Paper Size_orientation... - Grupos de Google

    2/2

    EndDoc;

    End; { Try..finally }

    End; { With Printer Do Begin }

    End; { btnPrint2Click Procedure }

    The problem is, that I am uncertain how to actually print a PDF, other

    than calling a shellexecute. We have Rave Reports Borland EditioneXteneded 7.0.3. I was wondering if it was possible to load the PDF

    file into RAVE, and send it to the printer from there? Maybe it can

    be done within Delphi itself...i'm open to ideas.

    Thank you for any help you are able to provide,

    JJ

    ng a PDF File to a specific printer while setting paper size/orientatio... https://groups.google.com/forum/print/msg/borland.public.delph

    2 14-01-20