Printpreview.LoadFromFile extra page

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Printpreview.LoadFromFile extra page

Postby Tom Rage » December 15th, 2006, 12:36 pm

Hi,

After printing -and saving- a single page document, I recall and reprint the document, see code below. There is a small difference...a second, blank page is printed. The preview also shows the empty page. Should I refresh/clear something before/after LoadFromFile?

Thanks,
Tom.

PrintPreview.BeginDoc;
PrintPreview.LoadFromFile(AFileName);
PrintPreview.PrintJobTitle := ExtractFileName(AFileName);
PrintPreview.EndDoc;
if AutoStartPrint then
begin
if PrintPreview.State = psReady then PrintPreview.Print
...
Tom Rage
Active Member
Active Member
 
Posts: 12
Joined: February 21st, 2004, 3:02 pm
Location: Belgium

Postby Kambiz » December 16th, 2006, 4:34 am

Just strip the BeginDoc and EndDoc lines.

PrintPreview.LoadFromFile(AFileName);
PrintPreview.PrintJobTitle := ExtractFileName(AFileName);
if AutoStartPrint then
begin
PrintPreview.Print;
...
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby Tom Rage » December 16th, 2006, 11:19 am

Thanks.

Tom.
Tom Rage
Active Member
Active Member
 
Posts: 12
Joined: February 21st, 2004, 3:02 pm
Location: Belgium


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest

cron