Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

printing new page under WIN98

Posted on 1998-12-29
3
Medium Priority
?
148 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 200 total points
ID: 1353592
Thanx...   :-)

Regards, Madshi.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

886 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