VPE hangs when printing outside the defined page

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VPE hangs when printing outside the defined page

Postby Bengt » Sat Oct 01, 2016 6:39 pm

I use VPE 7.1 with the Dataflex classes from StarZen. Many times I have run into the problem that printouts hangs without any error massage when printing outside the defined page. Often that has been due to my programming mistakes, but this time it isn't.

I print labels 80x40 mm as shown in the screen copy of the preview which I uploaded on Tinyupload.I have recognized that printouts are a bit different on different printers, and therefore I have made it possible set a top offset and a left offset in my program to move the printed text on the label. Depending on how these offset parameters are set, it might happen that text is printed outside the defined page.

The page is defined as follows:
Send DoVpeSetPageFormat VPAPER_USER_DEFINED
Send DoVpeSetPageWidth 800
Send DoVpeSetPageHeight 400

Lines and boxes can obviously be printed outside the page as shown in the preview. The two statements below works despite parts of the linnes are located outside the page.

Send DoVpeBox (iEtikLeft +30) (iEtikTop + 20) -740 -360
Send DoVpeLine (iEtikLeft +320) (iEtikTop + 290) (iEtikLeft +320) (iEtikTop + 380)

However, the following statements, when iEtikTop=100) hang up the program.

Send DoVpeSet VTOP (iEtikTop + 310)
Send DoVpeWrite (iEtikLeft+60) VTOP VFREE VFREE ("7. " + (String(EtikRad.ANTAL )))

but the statement below works and was used when the example in the preview file was printed. It is obviously so that if any part of the printed string is outside the page, the program hangs.

Send DoVpeWrite (iEtikLeft+60) 360 VFREE VFREE ("7. " + (String(EtikRad.ANTAL ))) // 370 does not work


Should VPE work like that? Is there any possibility to print text outside the defined page?

Bengt

Preview file:
http://s000.tinyupload.com/?file_id=474 ... 5710499387
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm

Re: VPE hangs when printing outside the defined page

Postby IDEAL Software Support » Mon Oct 03, 2016 9:35 am

It is likely that your program hangs due to the auto page break feature: When you print text below the defined page bottom margin, or if text extends over the bottom margin, VPE issues a page break and prints the remaining text on the next page, with y-top = the default page top-margin.

I am not sure, what exactly the problem is with your code, here a similar sample program is working as it should. A problem with endless looping can occur, if your page margins are defined in a way, so that no single line of text can be moved to successive pages, because the top margin and the bottom margin are too close.

For details on how the auto page break feature is working, please see the chapters "Page Margins" and "Automatic Text Break" in the Programmer's Manual, as well as the description of the AutoBreak property in the Reference Manual.

As a quick try, turn the auto page break feature completely off with:

VpeSetAutoBreak(hDoc, AUTO_BREAK_NO_LIMITS)
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE hangs when printing outside the defined page

Postby Bengt » Mon Oct 03, 2016 1:29 pm

Turning off autopagebreak made the program working.

Best regards,

Bengt
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm

Re: VPE hangs when printing outside the defined page

Postby IDEAL Software Support » Mon Oct 03, 2016 6:25 pm

If one thinks a bit longer about your problem, the cause becomes obvious:

The page margins are by default 2 centimeters away from the page borders. As your page is 4 cm high, there is no space left between the top and the bottom margin. So another solution would be to set the margins to zero.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE hangs when printing outside the defined page

Postby Bengt » Mon Oct 03, 2016 7:35 pm

I don't think that is a solution. What I want to do is to print outside the page border and I have alredy set the margins to zero. But Send DoVpeSetAutoBreak AUTO_BREAK_NO_LIMITS works,

Bengt
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 15 guests

cron