Formfeed, Preview and DevSendData function.

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Formfeed, Preview and DevSendData function.

Postby ADSOFT » Sun Nov 27, 2005 7:13 am

I'm new to Vpe and it's a great product.

The issue that we are having is that we print long forms that are in the neighborhood of 30inches. We setup Vpe so that we can print anywhere (i.e., AutoBreakMode is set to: Auto_Break_NO_Limits) and all the printing is fine, however.



When the page stops printing we need to send a FORMFEED command to ready the printer for the next page.

We tried DevSendData but it doesn't work. We read the other post and accept the fact that it is driver dependendent and useses the GDI (we are using VC++).

We got aroung the problem by creating a function that writes "raw data" to the printer and we can send it printer commands BUT:

We can't seem to use this technique when we preview the document because the "formfeed" command will not be picked up by the preview command.

Is there a way to get a message from VPE when the enduser hit the print button in Vpe's Preview Status bar. If we could trigger on this then we could send our linefeed after the end user hits the print button. At this point our app. only works when print directly to the printer, but when we preview and then print we have no way to send a formfeed.

Can you please make some recommendations?
ADSOFT
 
Posts: 5
Joined: Sun Nov 27, 2005 6:42 am

Postby IDEAL Software Support » Mon Nov 28, 2005 4:22 pm

If you are using the DLL, the event is:
VPE_PRINT
with wParam = PRINT_MSG_END

If you are using the Control, the event is:
.NET: RequestPrint Event with PrintAction = End

ActiveX: RequestPrint Event with Action = PRINT_MSG_END

VCL: OnRequestPrint Event with Action = PRINT_MSG_END

But for sending RAW data directly, you must wait until the Windows print spooler finished sending data to the printer. There is no safe way to detect this (i.e. we experimented with it, but due to different Windows versions and malfunctioning printer drivers, it was impossible to implement it in a way that could be called "reliable").

A safer way is to define a form in Windows and to use this form when printing.

Example: with "Start Menu | Settings | Printers" the window with the installed printers will appear. Right-click on a blank area of the window and choose "Server Properties" from the pop-up menu. In the upcoming dialog, define a custom form of the desired dimensions. For example name it "Test" and set the width to 760 and height to 1280.

In your source code, select the printer and the desired page format like this:
VpeSetDevice(hDoc, "Epson LQ-550");
VpeSetPageWidth(hDoc, 760);
VpeSetPageHeight(hDoc, 1280);

That's it.

We experienced that this property doesn't work with some printer drivers. We tested this for example on an Epson LQ-550 dot-matrix printer and it didn't work on WfW 3.11 and NT 3.51, but it worked on Win95. But we heared about, that a LQ-510 printer driver will solve the problem for the LQ-550. So if your printer does not respond to this setting, it is a printer driver problem. In that case you can try to use another compatible printer driver.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 8 guests

cron