exporting multiple pages

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jaysmurch
Newbie
Newbie
Posts: 3
Joined: Thu Sep 09, 2004 4:00 am
Location: chicago, il

exporting multiple pages

Post by jaysmurch » Mon Sep 13, 2004 5:15 pm

How can I export a chart over multiple pages, similar to printing over multiple pages?

I want to export a chart to a multi-page PDF file.

Thanks and regards.

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Sep 14, 2004 8:50 am

Hi,

you can use similar routine like the used for the "Print Multiple pages".
Here is the PrintPages routine:

Code: Select all

{ Sends pages to the printer. This only applies when the
  Chart has more than one page (MaxPointsPerPage property).
  If no parameters are passed, all pages are printed.
  If only one page exists, then it's printed. }
procedure TCustomAxisPanel.PrintPages(FromPage, ToPage: Integer);
var tmpOld : Integer;
    t      : Integer;
    R      : TRect;
begin
  if Name<>'' then Printer.Title:=Name; { 5.01 }
  Printer.BeginDoc;
  try
    if ToPage=0 then ToPage:=NumPages;
    if FromPage=0 then FromPage:=1;
    tmpOld:=Page;
    try
      R:=ChartPrintRect;
      for t:=FromPage to ToPage do
      begin
        Page:=t;
        PrintPartial(R);
        if t<ToPage then Printer.NewPage;
      end;
    finally
      Page:=tmpOld;
    end;
    Printer.EndDoc;
  except
    on Exception do
    begin
      Printer.Abort;
      if Printer.Printing then Printer.EndDoc;
      Raise;
    end;
  end;
end;
As you can see, nothing special to it. It simply traverses all chart pages
and prints them to separate printer pages. You can use similar code to export it in a Multiple pages.

Post Reply