Solved

printing new page under WIN98

Posted on 1998-12-29
3
137 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 200
Delphi Yen format 3 35
How to build JSON File in Delphi 6 3 34
Tvertscrollbox like a whatsapp layout delete messages 1 16
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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