Receit- / POS / Printer with VPE 6+

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Receit- / POS / Printer with VPE 6+

Postby DDTech » Mon Oct 24, 2011 3:11 pm

Hi Mr. Radde,

what is the recommendation for dealing with endless paper using POS Printers like the EPSON TM-T88 series?

The reason I'm asking is, that up to now I was using my old VPE3-Version for my cashier application and that worked fine, even with longer Reports on endless paper. I normally define a custom page format via the printer driver and select that. Worked flawlessly in Version 3 and does not in Version 6.1.

When I do .SetupPrinter(<FileName.prs>, 2) I select the "Roll Paper" (either the one defined with the printer setup by EPSON or my own definition) it is being saved to the file, but defaults to "A4" the next time SetupPrinter is called again.

I can set the .pageHeight to a higher value but .devPaperHeight remains at 2970 and cuts at that position.

I tried to manually override .devPaperHeight, but querying the value returns 2970 again.

I seached the forum, but the posts I found were older. The tip in these posts was to set pageHeight and "if this does not work the printer does not support it" which in this case is not true, as it works in Version 3 of VPE with the same printer and driver.

It seems to be a matter of order should I set .devPaperheight before pageheit, the other way round or only one of them?

I remember a note about changes of the behavior in pagexxx and devxxx values.

Do You have a tip

Thanks in advance

Regards from Berlin

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Tue Oct 25, 2011 7:17 am

A few years ago we did purchase exactly this printer for testing and development purposes. I remember that its printer-driver had some bugs, which caused problems with the version of VPE we had released at that time (with improved printer control), so we implemented a workaround into VPE, which should still be working.

I might be wrong, but as far as I remember you just need to set the PageHeight and PageWidth properties (NOT the DevPaperHeight/-Width properties!) and there you go. Since this a few years ago, please let us know if this helps.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby JudgeTerry » Wed Oct 26, 2011 5:59 am

There was a problem in an earlier version where VPE would set paper size to 'A4'. This is no longer a problem, but I wonder if the old workaround would help here?

VpeSetPrintOptions(hDoc,PRINT_NO_AUTO_PAGE_DIMS)

Just a thought,
Terry
JudgeTerry
 
Posts: 30
Joined: Thu Jan 22, 2009 10:56 pm

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Wed Oct 26, 2011 7:41 am

Setting PRINT_NO_AUTO_PAGE_DIMS causes that the properties PageHeight and PageWidth are without function for printing. In this case this would be counterproductive.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Tue Nov 01, 2011 11:11 am

Hi, Mr. Radde,

IDEAL Software Support wrote:... I might be wrong, but as far as I remember you just need to set the PageHeight and PageWidth properties (NOT the DevPaperHeight/-Width properties!) and there you go. Since this a few years ago, please let us know if this helps.


That was what I had done over the past few years when using VPE 3.x and what now does not work anymore.

However, the next post and Your reply gave me a hint.

IDEAL Software Support wrote:...Setting PRINT_NO_AUTO_PAGE_DIMS causes that the properties PageHeight and PageWidth are without function for printing. In this case this would be counterproductive.


I remember that I have set PRINT_NO_AUTO_PAGE_DIMS by default In my base-class. I'll check if this is inherited down to the "receit" base class. I'll play with this and let You know.

Thanks so far

Kind regards

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Tue Nov 01, 2011 3:23 pm

IDEAL Software Support wrote:...I might be wrong, but as far as I remember you just need to set the PageHeight and PageWidth properties (NOT the DevPaperHeight/-Width properties!) and there you go. Since this a few years ago, please let us know if this helps.


Unfortunately it's not working.
I created a very basic testreport and setting in order to avoid sideffects:

I created two forms, one with a VPE3, the other with a VPE6.1-Control on it and nothing else.

Code: Select all
#DEFINE V3 .F.
#IF V3
    #INCLUDE VPE3.H
    #DEFINE VUNIT_FACTOR_MM10 -1  && just a DUMMY-Constant not used in VPE3
    m.lcPRS    = "EPSON_TM-T88IV_RECEIPT3.PRS"

#ELSE
    #INCLUDE VPE.H
    m.lcPRS    = "EPSON_TM-T88IV_RECEIPT6.PRS"

#ENDIF

m.lcDevice       = "EPSON TM-T88IV Receipt"
m.lnVSpacing   = 500   &&  5cm vertical spacing between lines
m.lnDrawLines = 7     &&  seven lines with a 5cm spacing

#IF V3
   with m.oForm.oVPE
#ELSE
   with m.oForm2.oVPE
#ENDIF

   if .isOpen()
      .closeDoc()
   endif
   
   .openDoc()

   *-- not in V.3
   if .VPEVersion >= 5
      .UnitTransformation = VUNIT_FACTOR_MM10
   endif
   
   .SetupPrinter(m.lcPRS,2)          && Force printer to show dialog
   *.Device       = m.lcDevice    && or alternatively set Device without SetupPrinter(..)

   .PageHeight    = 4000             && Optionally try to force PageHeight/width to specific dimensions
   .PageWidth     = 800

   .nLeftMargin    = 40                && Set margins
   .nRightMargin   = .PageWidth - .nLeftMargin
   .nTopMargin     = 0
   .nBottomMargin   = .PageHeight
       
   .VPEWrite(50, 200, VFREE, VFREE, "Testreport")
   .VPEWrite(50, VBOTTOM, VFREE, VFREE, "PageHeight: "+trans(.pageHeight))
   .VPEWrite(50, VBOTTOM, VFREE, VFREE, "PageWidth: "+trans(.pageWidth))
   .VPEWrite(50, VBOTTOM, VFREE, VFREE, "VPE-Version: "+trans(.VPEVersion))
   
   m.lnTop = 0
   for m.lnI = 1 to 7
      m.lnTop = m.lnTop + m.lnVSpacing
      .Line(VLEFTMARGIN, m.lnTop, -300, m.lnTop)
      .Line(.nRightMargin-300, m.lnTop, .nRightMargin, m.lnTop)
      .TextAlignment = ALIGN_CENTER
      .Write(.nLeftMargin+300, lnTop-20, .nRightMargin-300, VFREE, trans(round(m.lnTop/100,2)))
   endfor &&* m.lnI = 1 to 10

   .PrintDoc(.F.)
endwith


The code has been compiled once with VPE3-Constants and once with Constants for VPE6. Also used separate PRS-Files which did not exist before.

VPE-3 had its own problems, but shows the selected papertype in SetupPrinter() and prints out a long receit with lines up to 35cm (7 * 5cm).

VPE-6.1 ignores the selected "Rollpaper endless" and shows "A4" each time I run the report. It Prints "PageHeight: 4000" but cuts after the 25cm line.
As PageHeight seems to be accepted but not sent down to the printer, setting .AutoBreakMode also has no effect.

Margins and page-dimensions need to be set in both cases, otherwise, even with predefined roll-paper of 80mm width, pagewidth seems to default to 210mm. As I set dimensions manually, using .setupprinter() or .Device= does not make a difference.

Leaving .UnitTransformation in V6 with its default-value (=working with cm) does not make a difference.

Am I missing something?

Kind Regards

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Wed Nov 02, 2011 6:17 am

First of all, to make sure there are no side-effects, remove the call to SetupPrinter().
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Wed Nov 02, 2011 9:18 am

IDEAL Software Support wrote:First of all, to make sure there are no side-effects, remove the call to SetupPrinter().


I did, I either commented the one or the other out and tried with either .setupPrinter() or .device= in order to see if it makes a difference.
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Thu Nov 03, 2011 5:54 am

We re-activated our EPSON TM-T88IV and wrote some test code:

Code: Select all
   hDoc = ::VpeOpenDoc(hwnd, "Sample Application", VPE_GRIDBUTTON);
   const VpeCoord page_width = 8;
   const VpeCoord page_height = 5;
   VpeSetDevice(hDoc, "EPSON TM-T88IV Receipt");
   VpeSetPageWidth(hDoc, page_width);
   VpeSetPageHeight(hDoc, page_height);
   VpeSetOutRect(hDoc, 0, 0, page_width, page_height);

   VpeLine(hDoc, 0, 0, page_width, 0);
   VpeLine(hDoc, 0, page_height, page_width, page_height);
   VpePrint(hDoc, 1, 1, "Hello World!");


It works as it should. What version of the printer driver are you using on what operating system version? Is your Windows 32- or 64-bit?

We are using WinXP 32-bit, SP3, the printer driver version dialog reports:
Install Version ATM_304E
EPSON TM-T88IV Receipt3 Printer Driver
Version 5.0.4.0

Epson Status API
Version 3.7.0.1
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Thu Nov 03, 2011 5:07 pm

IDEAL Software Support wrote:We re-activated our EPSON TM-T88IV and wrote some test code: ....
It works as it should.


Thanks, works on my side too, but that's only a page of 5cm height. Works fine with 5, 10, 20, 26 but fails on 35
I have no problems with shorter pages. but on longer reports in my setting a cut occurs after A4 height.
With this democode, if I set a pageheight of 31 or 35 cm, it cuts directly below "Hello World".

Could You please try what happens on your side with higher page heights.

This is the code I used:
Code: Select all
    m.lnPageWidth = 8
    m.lnPageHeight= 31

   if .isOpen()
      .CloseDoc()
   endif
   
   .OpenDoc()
   
   .Device = "EPSON TM-T88IV Receipt"
   
   .PageWidth = m.lnPageWidth
   .PageHeight= m.lnPageHeight
   .SetOutRect(0,0,m.lnPageWidth, m.lnPageHeight)
   
   .VPELine(0, 0, m.lnPageWidth, 0)
   .VPELine(0, m.lnPageHeight, m.lnPageWidth, m.lnPageHeight)   
   .VPEPrint(1,1, "Hello World")      

   .PrintDoc(.F.)


Same as Yours, but with ActiveX-syntax.

IDEAL Software Support wrote:What version of the printer driver are you using on what operating system version? Is your Windows 32- or 64-bit?
We are using WinXP 32-bit, SP3, the printer driver version dialog reports: Install Version ATM_304E EPSON TM-T88IV Receipt3 Printer Driver
Version 5.0.4.0 Epson Status API Version 3.7.0.1


Tried on VISTA 32bit SP2 and Windows 7 32. The driver is the latest Epson-driver reporting:
Version installieren
APD Ver4.51

EPSON TM-T88IV ReceiptE4
Version 5, 0, 15, 0

EPSON Status API
Version 4, 50, 0, 0



Kind regards

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Thu Nov 03, 2011 5:50 pm

Addition: Same code works fine with any pageHeight when using VPE 3.x
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Tue Nov 08, 2011 8:23 am

We testet with PageHeight = 31cm and indeed the paper is cut after the text "Hello World".

We then debugged through the code, and VPE sets correctly the paper dimensions. Afterwards the printer driver's settings are retrieved to check for correctness and the printer driver returns correctly the requested paper dimensions. So the driver did accept the values, but does not use them. This seems to be a bug in the driver, not accepting values for page height which are larger than A4 (29.7 cm).

Since if this is a bug of the driver, it must fail in VPE v3.60 also, therefore we made the same test with VPE v3.60 Release 4 (the last release) afterwards.

It shows the same problem, the paper is cut after the text "Hello World".

It *might* be, that you are using an older version of VPE than v3.60 R4 and that it did use a different technique to control the printer's page dimensions, but since the current technique is working best with nearly all drivers, we won't change that. Just for informational purposes: what edition, version and release of VPE are you using? Please right-click onto the DLL to get the version number.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Tue Nov 08, 2011 4:36 pm

IDEAL Software Support wrote:... Just for informational purposes: what edition, version and release of VPE are you using?...


Thanks for looking into this.
The Version it's working with is an older one. It's the Enhanced Edition Version V. 3.10.0.3 VPEX32.dll

The one I'm currently using is the Professional Edition V. 6.1.0.6508

Kind regards

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: Receit- / POS / Printer with VPE 6+

Postby IDEAL Software Support » Fri Dec 09, 2011 3:44 pm

We re-examined this problem and found a solution.

First of all, we pulled the sources of VPE v3.10 from a burned backup CD. Our source code control system only goes back down to v3.60. (Did you know that 10 year old CD's (a Verbatim) start to become unreadable? We did not expect this! But we could manage to retrieve the source codes related to printer control.) What we found out from the old sources is that the code changed a lot and became much more sophisticated, but the logic is the same. We were not able to make the printer function properly, even when we exactly did re-inject the old source code of v3.10 into v6.10 for experimental purposes.

So we played with the printer driver, and indeed there is an important setting!

1) In the Windows printer control panel, click onto "Properties" of the TM-T88IV printer.
2) Switch to the layout tab.
3) Select Paper Size = "User Defined"
4) A dialog pops-up. There, the page height is set to 2970 (which is A4). Change it to a higher value, say 32760 - which is the maximum possible value. This way you change the basic system setting of the printer to a theoretical maximum value.

Afterwards it works as it should, and the paper is cut at the position specified through VPE.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: Receit- / POS / Printer with VPE 6+

Postby DDTech » Thu Jan 08, 2015 7:30 pm

Hello Mr. Radde,

sorry, I just saw Your answer today.

IDEAL Software Support wrote:We re-examined this problem and found a solution.....


Thank You for looking into the matter again. And yes, I know those burned CDs are just a little bit better than VHS- or Audio-tapes used to be :)

Actually I never solved the problem so that it would be safe enough for a remote install. My application is being used by just a few clients, but those are spread all over europe so that an on site installation or support is close to not possible.

At the time I was dealing with the page-length problem I also played a lot with the custom paper format and a long 80 x 3200 mm type called "Endlospapier" was the first thing I set up after installing the driver. However, I never got this to work properly. Just retried with my old testcode and the new Version 7. Maybe I was missing something.
The setting seems to be there ( If you switch off "Papiereinsparung" ("paper save" ?) under document settings, you get a looooooong slip for a simple "Hello world") but "pageHeight" still claims to be 2970.

Anyway, I came to another solution, which works ablsolutely flawless for the past few years now.
Hopefully someone else can benefit from this approach:

I now just take the pageHeight as it is. I actually do not even set up the custom paperformat anymore but leave the stupid default "A4" instead.
After .SetupPrinter(<filename>,0) I set .pageWidth and margins from a config file.
Then I start building the report and - the same way I would do it on a flat page report - check the available space to the .bottomMargin at certain points.
If there is not enough space available, I simply break onto a new page, set my margins and continue with the report.
On the printout You will not see the breaks and I think You don't even hear them (no pause or slowdown) while printing.

Another benefit from this approach is, that you can produce a pdf which is not an 80 mm wide but 3 m long single page document (basicly useless) but a multipage document which can be printed on a normal printer (margins can be a broblem though, but as pdfs can be centered and resized to printable area this can be easily solved too).

If You do also need preview capabilites (like I do), You might have to implement some forking for preview vs. printout.



Kind regards

Frank Dietrich
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Next

Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 10 guests

cron