Hi pcsentinel
Thanx for your reply , I will have a look and let you know, i am currently out of the office
Main Topics
Browse All TopicsGood Day,
I need to print invoices to a dot matrix printer on pre printed stationery, before I want to start doing the work
I need to know what is the best method and easiest method to print to dot matrix and pre printed stationery.
I am currently using quickreport 3 for all my other printing, but according to other developers it is not so easy to print to dot matrix and on
pre printed stationery, because you must take form feed and cotrol sequenses in consideration.
If possible can you give me examples or links to good examples on printing to dot matrix with pre printed stationery.
Thank you
Henry
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
That IS Joe Hect's code, check this with an example:
http://216.101.185.148/scr
here is link to Google archive of same thread:
http://tinyurl.com/f4ted
Business Accounts
Answer for Membership
by: pcsentinelPosted on 2006-08-25 at 01:20:11ID: 17387672
You might find it easier to using raw printing, i.e. sending data directly to the printer. In my experience it can be very difficult to get things lined up, especially if you have many fields that need to be aligned.
me : pChar;
me : pChar; Name), or); or);
or);
or);
or);
or); or);
I use a unit with the following functions
(I am sorry but cant remember where I got the code from origimally - so apologies to author)
unit printraw;
interface
uses
WinTypes, sysutils, dialogs;
type SpoolInt = DWORD;
function StartRawPrintJob(PrinterNa
Port : pChar;
DocName : pChar) : THandle;
function StartRawPrintPage(hPrn : THandle) : integer;
function PrintRawData(hPrn : THandle;
Buffer : pointer;
NumBytes : SpoolInt) : integer;
function EndRawPrintPage(hPrn : THandle) : integer;
function EndRawPrintJob(hPrn : THandle) : integer;
implementation
uses
WinProcs,
WinSpool;
function StartRawPrintJob(PrinterNa
Port : pChar;
DocName : pChar) : THandle;
var
hPrn : THandle;
DocInfo1 : TDocInfo1;
msg: string;
begin
if (OpenPrinter(PChar(Printer
hPrn,
nil) = FALSE) then begin
Result := THandle(-1);
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
Exit;
end;
DocInfo1.pDocName := DocName;
DocInfo1.pOutputFile := Port;
DocInfo1.pDataType := 'RAW';
if (StartDocPrinter(hPrn,
1,
@DocInfo1) = 0) then begin
Result := THandle(-1);
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
Result := hPrn;
end;
function StartRawPrintPage(hPrn : THandle) : integer;
var
msg: string;
begin
if (StartPagePrinter(hPrn) = FALSE) then begin
Result := -1;
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
result := 1;
end;
function PrintRawData(hPrn : THandle;
Buffer : pointer;
NumBytes : SpoolInt) : integer;
var
BytesWritten : DWORD;
msg: string;
begin
if (NumBytes = 0) then begin
Result := 1;
exit;
end;
if (WritePrinter(hPrn,
Buffer,
NumBytes,
BytesWritten) = FALSE) then begin
Result := -1;
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
if (NumBytes <> BytesWritten) then begin
Result := -1;
exit;
end;
Result := 1;
end;
function EndRawPrintPage(hPrn : THandle) : integer;
var
msg: string;
begin
if (EndPagePrinter(hPrn) = FALSE) then begin
Result := -1;
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
Result := 1;
end;
function EndRawPrintJob(hPrn : THandle) : integer;
var
msg: string;
begin
if (EndDocPrinter(hPrn) = FALSE) then begin
Result := -1;
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
if (ClosePrinter(hPrn) = FALSE) then begin
Result := -1;
Msg := SysErrorMessage(GetLastErr
MessageBox(0, pChar(Msg), 'Error', mb_OK);
exit;
end;
Result := 1;
end;
end.
then you just right our raw data to the printer, treating it as a dos printer