Page 1 of 1

exporting multiple pages

Posted: Mon Sep 13, 2004 5:15 pm
by 9339111
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.

Posted: Tue Sep 14, 2004 8:50 am
by Pep
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.