Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 12th, 2012, 05:16 AM
dompallot dompallot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 dompallot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 25 sec
Reputation Power: 0
EPL Code Zebra Printer Help.

Hello,

I'm sending EPL code to a zebra printer. Printing one ticket works fine, but If I print a list of tickets it spits out too much paper after ticket 4 and misaligns the rest!

I've looked at and changed my code so many times but I cant see the problem. Has anyone any experience with sending EPL code?

I've tried sending it all as one print document and as individual documents.

Thankyou.



(there might be some erroneous variables below that are used for my EPL code)

Code:
procedure TPrintorExcelFRM.Button8Click(Sender: TObject);
var ADevice, ADeviceName, ADevicePort: array[0..255]of Char;
PrinterHandle: THandle;
DocInfo: TDocInfo1;
dwJob: cardinal;
dwBytesWritten: cardinal;
AUtf8: UTF8string;
ADeviceMode: THandle;
i : integer;
SNO : String;
Number : String[2];
Desc:String;
f : TextFile;

begin
  wordsearchfrm.DBGrid1.DataSource.DataSet.First;

  repeat
  //choose printer (a windows generic printer works fine)
  Printer.PrinterIndex := Printorexcelfrm.cboPrinter.ItemIndex;
  Printer.GetPrinter(ADevice, ADeviceName, ADevicePort, ADeviceMode);

  //Obtain a handle to the printer
  if not OpenPrinter(ADevice, PrinterHandle, nil)
  then Exit;

  //Fill in the structure with info about this "document"
  DocInfo.pDocName := PChar('Ticket');
  DocInfo.pOutputFile := nil;
  DocInfo.pDatatype := 'RAW';

  //Inform the spooler the document is beginning
  dwJob := StartDocPrinter(PrinterHandle, 1, @DocInfo);
  if dwJob = 0 then begin
  ClosePrinter(PrinterHandle);
  PrinterHandle := 0;
  Exit;
  end;

  //Start a page
  if not StartPagePrinter(PrinterHandle) then begin
  EndDocPrinter(PrinterHandle);
  ClosePrinter(PrinterHandle);
  PrinterHandle := 0;
  Exit;
  end;
  /////////////////////////////////////
 

  //your epl code...
  //NOT INCLUDED
  wordsearchfrm.DBGrid1.DataSource.DataSet.next;

   //End the page
  if not EndPagePrinter(PrinterHandle) then begin
  EndDocPrinter(PrinterHandle);
  ClosePrinter(PrinterHandle);
  PrinterHandle := 0;
  Exit;
  end;
//end;

  //Inform the spooler that the document is ending
  if not EndDocPrinter(PrinterHandle) then begin
  ClosePrinter(PrinterHandle);
  PrinterHandle := 0;
  Exit;
  end;

  //Tidy up the printer handle
  ClosePrinter(PrinterHandle);
  PrinterHandle := 0;

until wordsearchfrm.DBGrid1.DataSource.DataSet.Eof;

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > EPL Code Zebra Printer Help.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap