Continuous Print with DCPRINT

This forum is for eXpress++ general support.
Post Reply
Message
Author
gradosic
Posts: 45
Joined: Tue Dec 07, 2010 2:11 pm
Location: Croatia - Europe
Contact:

Continuous Print with DCPRINT

#1 Post by gradosic »

Hi folks!

I have problem with printing to printers that have "Continuous" paper, no standard A4 or other format. Those printers have Thermal paper on roll and length of page can be 2cm or 20 met. When I print with DCPRINT on beginning I need to set page width and height (for grid), but when I print on this printer I can't know what length (height) of document will be. For example, if I print Invoice, it's possible that invoice have 2 articles or 2000 articles. On A4 printer i normally use eject command to start new page, but with this (thermal) printer there is no end of page.
Is anyone have some proposal how to resolve this (other than count lines before printing) ?

Thanks!
Goran Radosic

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: Continuous Print with DCPRINT

#2 Post by bobvolz »

This may or may not help you. I had a similar issue printing long forms to a dot matrix printer. The form could be anywhere from 6 inches to 33 inches long.
I used the Windows print server to create a long form (named AutoMan) of 10 inches X 33 inches on each PC that needs it. You can make your own form name and do the conversion to metric :).
It works great. You must create a form long enough to handle your MAXIMUM length if that is possible. I am not sure if Windows has a limit.
It makes no difference since DCPRINT OFF or Eject will stop the printing and paper movement when the form is done. All the print server form does is set an
outside limit for your form length and width.
The important factor here is that you MUST find that Formname in the Print Server to get the numeric nFormsize for DCPRINT.

I first create a printer object o
o:= XbpPrinter():new()
o:create(cPrinter) //!!Important cPrinter is the exact name of the Printer on your system. Example 'LaserJet P2035'
You can retrieve the printer name you want to use from a local ini file or you could hard code it.
Then get an array of forms available for that printer using aArray:=o:forms
aArray:= o:forms()
Then Destroy o /// no longer needed once array is created
o:DESTROY()

Then have Ascan scan the array for your form name- to return nSelect -mine is AutoMan
nSelect:=ASCAN(aArray,'AutoMan')

The Windows print server formsize is the first element of the array aArray
nFormsize:=aArray[nSelect,1] /// first element of array is the windows print server formsize. This is a numeric value unique to the print server
on that PC

Then use DCPRINT ON to create oPrinter object using nFormsize
DCPRINT ON to oPrinter NAME cPrinter PIXEL FORMSIZE nFormsize FONT cFont

Hope this helps

Bob Volz

gradosic
Posts: 45
Joined: Tue Dec 07, 2010 2:11 pm
Location: Croatia - Europe
Contact:

Re: Continuous Print with DCPRINT

#3 Post by gradosic »

Hi Bob!

Thanks’ for reply, but this doesn’t work because I have hundreds of users and each of them have different printer, so it’s impossible to install anything on user computers. That’s usually some 80mm wide termo printer, and till now everything was OK because we printed as RAW formatted (line by line), but now we need to change to windows graphic print and it’s problem. I can put maximum DCPRINT size to 80, 100000 but I didn’t get anything with that because it’s scale fonts so I don’t see anything.
With Your suggestion I get this forms on my printer ({{227, "80 x 297mm"}, {228, "80 x 210mm"}, {229, "82.5 x 297mm"}, {230, "82.5 x 210mm"}, {231, "Custom Paper-S80"}}), and none of them is good for this solution.

This is example of invoice that I get when I put DCPRINT size 200, 800 (it’s looking good): http://prntscr.com/uvz69f, but if I have more then 10 articles there is no place to print them out. So if I put DCPRINT size to 200, 3000 (so I can print more lines) I get this: http://prntscr.com/uvz7k3, normally because I change scale ratio…

I need to find way hot to NOT determine Y size of form print (height)…
Goran Radosic

Koverhage
Posts: 150
Joined: Mon Feb 01, 2010 8:45 am

Re: Continuous Print with DCPRINT

#4 Post by Koverhage »

Why you must change to windows print ?

see: http://bb.donnay-software.com/donnay/vi ... 5106#p5106
Klaus

gradosic
Posts: 45
Joined: Tue Dec 07, 2010 2:11 pm
Location: Croatia - Europe
Contact:

Re: Continuous Print with DCPRINT

#5 Post by gradosic »

Hi,

I need graphich print becaouse I need to print pictures and different size fonts.
Goran Radosic

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: Continuous Print with DCPRINT

#6 Post by bobvolz »

Hi Goran;
Note in my example that I do not pass in DCPRINT parameters for SIZE.
I believe the FORMSIZE nFormsize parameter does all that for you. The nFormsize value is found in the Print Server for the Name of the form you created.

I believe you need only ONE Printer Server Form whose size is set at the maximum you think it will ever need.
It looks like you tried to set up several form sizes. I would set up only ONE in Print server at 50cm X 300cm . That would enable you to print any
form up to 5 feet long if that is enough length to handle all your possible print needs. If not, you can make it longer.
Yes, you would have to set this Print Server Form on all your PC's that will need it. You would also have to have a common printer name on each PC OR some
way to extract it from an .ini file local to each PC so your program can find the nFormsize you created when it builds the array with oForms:printername.
Then use the code I suggested to extract that nFormsize number in your app. Once you have the nFormsize value you can pass it to DCPRINT. There is no need for any SIZE parameters.

DCPRINT ON to oPrinter NAME cPrinter PIXEL FORMSIZE nFormsize FONT cFont

This works for us. We have a local .ini file that contains the Printer Name that needs to use the custom form. The printer name can be different on every PC. but the Print server forms must be the same on each PC.
Once that is set up whenever you need to print just extract the nFormsize you need from the PC's printer server and you can print all you like
as long as it will fit inside the nFormsize maximum sizes.
Good luck
Bob Volz

Post Reply