Solved

printing new page under WIN98

Posted on 1998-12-29
3
134 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanx...   :-)

Regards, Madshi.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now