Page 1 of 1

Tprintprview : Re-edit a canevas ?

PostPosted: April 8th, 2004, 9:22 am
by dav999
Hello

i have 3 pages on my project, if i have create page N°3 with .NewPage procedure, can i edit the canevas in my second page ?

i have a little problem for calculate total number (pages) of my print, and i have trying to edit a canevas, but i can't rewrite on this canevas (n°2)

Can i edit a canevas, if a i have create already a new page ?

Thanks
excuse for my poor english, but if anyone speak french :)
David

PostPosted: April 11th, 2004, 2:10 pm
by Kambiz
Each page is a metafile, so you can edit it.

PostPosted: May 13th, 2004, 12:10 pm
by dav999
I can edit each page ?

Can i seek the first page and make this :
print.canevas.textout(150,150,'Text');

i can't reedit my page for insert the n# total of my pages

Thanks
David

ps : i try to add after 2 pages in manual mode (drawtext, textout,...), to insert a RTF document, it's no a problem ?

if you would i can send you the source code

PostPosted: May 14th, 2004, 10:54 am
by Kambiz
I added BeginEdit and EndEdit methods to the control's interface. Using these methods, editing an existing page is similar to its creation.

For example, the following code can be used for your purpose:

Code: Select all
with PrintPreview do
  for PageNo := 1 to TotalPages do
    if BeginEdit(PageNo) then
      try
        // Use Canvas to draw on the page
      finally
        EndEdit;
      end;

By the way, while editing a page, PrintPreview.State property is psEditing.

Cheers,
Kambiz

PostPosted: May 14th, 2004, 11:15 am
by dav999
Ok thanks for your great componants

i go immediatly download the new version

david