Normal Topic NewPage definition with PrintString (Read 1046 times)
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
NewPage definition with PrintString
Apr 27th, 2009 at 5:09pm
Print Post Print Post  
I am trying to use PrintString to print continuous feed inventory labels on an Citizen/Epson dot matrix printer (a plug for Citizen printers - we've been continuously using this same printer, hundreds of labels per day, for 19 years!).  I have the following code for the print button.  The part that doesn't work is the size of the page - I need to define the page as 3.5" across, 1" high, and 6 lines deep.  

If vCount > 0
      {
     
     For vLoop = 1 To vCount
       NewPage(350, 100)
       PrintString(vItemNum, 12, 12, 0, " ARIAL", 4, 0)
       PrintString(vItemDesc, 12, 24, 0, " ARIAL", 4, 0)
       PrintString("----------------", 100, 48, 0, " ARIAL", 4, 0)
         PrintString("WordCom", 30, 54, 0, " ARIAL", 4, 0)
       PrintString("PO#" + " " + vPONum, 100, 54, 0, " ARIAL", 4, 0)
       FinishPage()
     Next

I think I understand better now that NewPage won't set the size of the label for me.  Would Print_Paper_User be what I'm looking for (as a 'type' of PrintPagePaper())?  If so, how do I define it?
« Last Edit: Apr 27th, 2009 at 9:33pm by lksseven »  

Larry
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: NewPage definition with PrintString
Reply #1 - Apr 30th, 2009 at 4:28pm
Print Post Print Post  
I don't think you can use the PrintString commands to print directly to a label printer.
If you don't already have a subscription to InsideSesame, lksseven, you should get one - I've found them to be very useful. There's an article in this month's issue that focuses on printing using label printers.
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: NewPage definition with PrintString
Reply #2 - Apr 30th, 2009 at 4:56pm
Print Post Print Post  
Acebanner wrote on Apr 30th, 2009 at 4:28pm:
I don't think you can use the PrintString commands to print directly to a label printer.
If you don't already have a subscription to InsideSesame, lksseven, you should get one - I've found them to be very useful. There's an article in this month's issue that focuses on printing using label printers.


Label printers are probably not a problem (depends on drivers), but dot-matrix printers are probably a problem. They are very low accuracy machines and the their drivers probably do not support the random access that is required.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: NewPage definition with PrintString
Reply #3 - Apr 30th, 2009 at 7:50pm
Print Post Print Post  
Ace Banner,

Yes, I am a subscriber to InsideSesame, and laughed this morning when I printed out the May2009 issue and there on page 10 is an article about printing directly to a Brother QL series label printer (the rub with the Brother is that while the printer itself is inexpensive ($140 for the network version), the Brother labels cost about 2.5cents each, versus 7/10 of a penny per thermal transfer label for a Zebra GX420t, for example.  Of course, the Zebra is about $520, so it's pay-me-now-or-pay-me-later ... at 100 labels a day, that's about a $35/month difference in label overhead, or about 11 months until the Brother solution becomes the more expensive solution, and then keeps on becoming the even-more-expensive solution).  But, the Brother would be the easiest/quickest to implement NOW, as InsideSesame has already done most of the heavy lifting for me.  I'll probably do that, and revisit that issue down the road once we're up and rolling for awhile.

Mark,
PrintString will print to dot matrix printers just fine (and I'm just printing simple inventory labels and delivery labels, so ultra-precision is not needed) - the problem is that none of the modern Windows print drivers for Epson-style  dotmatrix printers will allow you to set the page length at 1" with 'no form feed' - the drivers are all 'form' oriented, not 'line' oriented (so you can set the 'page' to 1" on the doc, but when the program dishes the job off to the Windows print driver, it advances the labels 11", whether it needs it or not. 
        As we've been generating these labels every day for 25 years on Q&A, which has its own epson print driver and does allow page definitions of 1", I didn't realize that printing labels was going to be such a challenge ("My kingdom for a nail!").  Just another reason to be irritated with Windows, I guess.

Thanks!
  

Larry
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: NewPage definition with PrintString
Reply #4 - May 1st, 2009 at 12:50pm
Print Post Print Post  
Can you set the page height to match the driver, then advance the "y" position by one inch for each label, without advancing the page - until it gets to the bottom of what the driver considers a page?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Re: NewPage definition with PrintString
Reply #5 - May 2nd, 2009 at 3:11am
Print Post Print Post  
no, I don't think so.  The Windows Epson driver (thanks, Bill!) does not offer a 'no form feed' option, nor does the printer itself.  The 'on printer' options does give me an option to set page height, but the smallest height is 6", which still doesn't work.

Very frustrating  - all I want to do is pull in 4 fields and print a little 3.5" wide by 1" high schlep half-a-penny mailing label.  But the last stop before the printer is the print driver, and I can't find a Windows Epson driver that gives  you the option of variable page height and form feed advance.

So, I bought a Brother QL-580n label printer (based upon Inside Sesame's experience in getting a print-direct-to-label-printer success).
  

Larry
Back to top
IP Logged
 
lksseven
Full Member
***
Offline



Posts: 416
Location: Southwest
Joined: Jan 26th, 2009
Update! Re: NewPage definition with PrintString
Reply #6 - May 2nd, 2009 at 11:50pm
Print Post Print Post  
The following code print perfectly to the Brother QL580n label printer.  There was an article in InsideSesame this month with code to allow printing direct to Brother label printers.  But I like the simplicity and reliability of PrintString.  

PrintLabel command button:Shockedn Element Entry

var vSONum as String
var vClientID as String
var vSODate as Date
var vOrderer as String
var vClientPO as String
var vCount as Int
var vLoop as Int

var vAnswer as Int
var vFinal as Int

vSONum = @FORMFIELDVALUE("Orders","SONum",0)
vClientID = @FORMFIELDVALUE("Orders","ClientID",0)
vSODate = @FORMFIELDVALUE("Orders","SODate",0)
vOrderer = @FORMFIELDVALUE("Orders","Orderer",0)
vClientPO = @FORMFIELDVALUE("Orders","ClientPO",0)

If @Mode() < 2
   {
     vAnswer = @PromptForUserInput("How many labels for this order would you like to print?", "")
     vFinal = @ToNumber(vAnswer)
     vCount = vFinal
     If vCount > 0
      {
     For vLoop = 1 To vCount
         NewPage(840, 240)
         PrintPageOrientation(2)
         AlternateDefaultPrinter("wcLabel1")

         PrintString("ClientID: " + vClientID, 6, 6, 0, " ARIAL", 12, 0)
         PrintString("Date: " + vSODate, 150, 6, 0, " ARIAL", 9, 0)
         PrintString("For: " + vOrderer, 6, @PageExtentY(), 60, " ARIAL", 10, 0)
         PrintString("ClientPO#: " + vClientPO, -1, -1, 0, " ARIAL", 10, 0)
         PrintString("Sales Order #: " + vSONum, 6, @PageExtentY(), 0, " ARIAL", 10, 0)
         PrintString("---------------------------------------------------", 6, @PageExtentY(), 0, " ARIAL", 10, 0)
         PrintString("MyCompany   xxx-xxx-xxxx", 10, @PageExtentY(), 0, " ARIAL", 9, 0)

       FinishPage()
     Next
       RestoreDefaultPrinter()
       
      }
   }
  

Larry
Back to top
IP Logged