Can't Find Declaration for TTeePDFPage

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
rgsolutions
Newbie
Newbie
Posts: 7
Joined: Mon Jun 09, 2014 12:00 am

Can't Find Declaration for TTeePDFPage

Post by rgsolutions » Wed May 20, 2015 1:02 am

I have just upgraded to C++ XE8 and have updated the Steema packages. My application uses the information in a TTeePDFPage class object to form PDF output. When I compile the application, it does not find the class declaration. I have scanned through the installed files and cannot find any reference to the class.

I looked at your latest reference document (that was downloaded along with the install), and it shows that the TTeePDFPage is part of the TeePDFCanvas unit.

Could you please let me know what I am doing wrong?

Thanks

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Can't Find Declaration for TTeePDFPage

Post by Yeray » Wed May 20, 2015 10:04 am

Hello,

I'm afraid this unit suffered lots of changes, to support stand-alone PDF Canvas, better speed with images, etc, etc.
The TTeePDFPage doesn't exist any more. Try using TPDFDocument instead.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

rgsolutions
Newbie
Newbie
Posts: 7
Joined: Mon Jun 09, 2014 12:00 am

Re: Can't Find Declaration for TTeePDFPage

Post by rgsolutions » Wed May 20, 2015 8:32 pm

Thanks for the information. I can really appreciate that things like this have to change.

I do have a request. Is there any documentation, examples, or anything available regarding the use of TPDFDocument? This class is not included in the latest reference material and I would like to know how it is used. Once I have this information, I think I can make the adjustments that I need.

Thanks for any help you might provide.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Can't Find Declaration for TTeePDFPage

Post by Yeray » Fri May 22, 2015 11:39 am

Hello,

Here it is a simple test example showing how to create a multi-page pdf document and how to add charts, images or how to use custom drawing function in each page:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
const PDF='C:\tmp\test.pdf';

var c : TPDFCanvas;
    b : TBitmap;
begin
  c:=TPDFCanvas.Create;
  try
    c.Document.Orientation:=poLandscape;

    c.StretchDraw(Rect(50,150,400,400),Image1.Picture.Graphic); // png
    c.Draw(450,150,Image2.Picture.Graphic);  // png

    c.TextOut(50,50,'Hello');

    c.Font.Size:=24;
    c.TextOut(250,50,'World !');

    TPDFExportFormat.Draw(c,Chart1,Rect(0,80,500,300));

    b:=Chart1.TeeCreateBitmap;
    try
      c.Draw(350,650,b);
    finally
      b.Free;
    end;

    c.Brush.Style:=bsSolid;
    c.Brush.Color:=clLime;
    c.Pen.Style:=psSolid;
    c.Pen.Color:=clBlue;
    c.Pen.Width:=1;

    c.Gradient.Visible:=True;
//    c.Gradient.StartColor:=$8000FF00; // Alpha /CA Constant Opacity
    c.Ellipse(420,10,520,110);
    c.Gradient.Visible:=False;

    c.Pen.Style:=psDot;
    c.Rectangle(550,10,650,110);

    c.Brush.Style:=bsClear;
    c.Pen.Style:=psDash;
    c.Pen.Width:=3;
    c.TriangleWithZ(Point(660,110),Point(700,10),Point(740,110),0);

    c.NewPage;

    TPDFExportFormat.Draw(c,Chart1,Rect(0,80,500,300));

    c.NewPage;

    Chart1[0].FillSampleValues;
    TPDFExportFormat.Draw(c,Chart1,Rect(0,80,500,300));

    c.SaveToFile(PDF);
  finally
    c.Free;
  end;

  TeeGotoURL(0,PDF);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

rgsolutions
Newbie
Newbie
Posts: 7
Joined: Mon Jun 09, 2014 12:00 am

Re: Can't Find Declaration for TTeePDFPage

Post by rgsolutions » Mon May 25, 2015 11:30 pm

The example was really helpful, thanks.

One more question. If I have an existing and already formatted TChart, how do I get it go to PDF? For example, I am displaying the chart to the user and he selects an option (which I give him) to export it to PDF, how can I control the output using TPDFExportFormat, TPDFCanvas, or some other class? In other words, how do I convert an existing chart to PDF?

Thanks for any help you can give.

rgsolutions
Newbie
Newbie
Posts: 7
Joined: Mon Jun 09, 2014 12:00 am

Re: Can't Find Declaration for TTeePDFPage

Post by rgsolutions » Tue May 26, 2015 12:01 am

Figured it out. Just need to get it formatted correctly as it is on the screen.

Post Reply