Solved

printing new page under WIN98

Posted on 1998-12-29
3
139 Views
Last Modified: 2010-04-04
hi,
i have written in D3 a small program which prints all available fonts on a system. Under WIN95 all works well.
now i changed to a new system with WIN98. The first page was printed correct, but the second and the following pages were filled with black rectangles instead of text (it looks like the text was printed in black, but with black bakcground).
now i changed the command "Printer.newpage" to "printer.enddoc" "Printer.begindoc" and all was ok.
What is the reason for this behavior ?

thanks
titz
0
Comment
Question by:titz
  • 2
3 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1353590
Here's the code, but don't ask me why your problem occurs... Perhaps the printer driver is not ok. Have you tried it with another driver/printer?

procedure TPrinter.BeginDoc;
var
  CTitle: array[0..31] of Char;
  DocInfo: TDocInfo;
begin
  CheckPrinting(False);
  SetState(psHandleDC);
  Canvas.Refresh;
  TPrinterCanvas(Canvas).UpdateFont;
  FPrinting := True;
  FAborted := False;
  FPageNumber := 1;
  StrPLCopy(CTitle, Title, SizeOf(CTitle) - 1);
  FillChar(DocInfo, SizeOf(DocInfo), 0);
  with DocInfo do
  begin
    cbSize := SizeOf(DocInfo);
    lpszDocName := CTitle;
    lpszOutput := nil;
  end;
  SetAbortProc(DC, AbortProc);
  StartDoc(DC, DocInfo);
  StartPage(DC);
end;

procedure TPrinter.EndDoc;
begin
  CheckPrinting(True);
  EndPage(DC);
  if not Aborted then Windows.EndDoc(DC);
  FPrinting := False;
  FAborted := False;
  FPageNumber := 0;
end;

procedure TPrinter.NewPage;
begin
  CheckPrinting(True);
  EndPage(DC);
  StartPage(DC);
  Inc(FPageNumber);
  Canvas.Refresh;
end;

Hope this helps...

Regards, Madshi.
0
 
LVL 1

Author Comment

by:titz
ID: 1353591
Madshi,

you are right: i installed the printer driver new and all was correct. send me your answer and you will have the points.

Thanks
titz
0
 
LVL 20

Accepted Solution

by:
Madshi earned 50 total points
ID: 1353592
Thanx...   :-)

Regards, Madshi.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question