Home Devices

Portrait/landscape mode in an archive

edited February 2003 in Devices
With the archive viewer, how can I determine whether the report in the
archive file is in portrait or in landscape mode?

Comments

  • edited February 2003
    Use the ArchiveReader's OnInitializePrinterSetup event. You can set the
    printer setup in this event, but you'll have to rearrange the draw commands
    on each page to fit for the orientation. The archive is generated for a
    specific output format. There is no event on the ArchiveReader to change the
    draw commands, on a page by page basis. You may be able to use the
    ScreenDevice's OnReceivePage public event to alter the draw commands on the
    page. Setup this event assignment in the OnPreviewFormCreate event of the
    ArchiveReader:
    TppViewer(ppArchiveReader1.PreviewForm.Viewer).ScreenDevice


    procedure Tfrm0151.ppArchiveReader1InitializePrinterSetup(Sender: TObject);
    begin

    if (ppArchiveReader1.PrinterSetup.Orientation = poLandscape) then
    ShowMessage('Landscape')
    else
    ShowMessage('Portrait');

    end;

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.