Duplex printing and tray selection Laserjet 5si

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Duplex printing and tray selection Laserjet 5si

Postby AndrewKennard » Mon Jun 23, 2008 2:17 pm

Hi all

Just doing some testing with VDF and the demo version of VPE

I need to be able to dynamically change the source tray and duplex mode between pages on a Laserjet 5Si

I have tried the following code ....

Move (VpeOpenDoc(mywinh , "Hello World..." , VPE_NO_MAILBUTTON)) to hDoc
Move ( VpeLicense (hDoc, "LIC1", "LIC2") ) to void
Move ( VpeSetCharset ( hDoc, 255 ) ) to void // OEM Charset
Move ( VpeSetPaperView ( hDoc, 1) ) to void
Move ( VpeSetPaperBin(hDoc, VBIN_UPPER) ) to void
Move ( VpeSetDevDuplex(hDoc,VDUP_VERTICAL) ) to void
Move ( VpeGetLastError(hDoc)) to void
Move ( VpePageBreak(hDoc)) to void
Move ( VpePageBreak(hDoc)) to void
Move ( VpeSetDevDuplex(hDoc,VDUP_SIMPLEX) ) to void
Move ( VpeSetPaperBin(hDoc, VBIN_LOWER) ) to void
Move ( VpePageBreak(hDoc)) to void
Move ( VpePageBreak(hDoc)) to void
Move ( VpeSetPaperBin(hDoc, VBIN_UPPER) ) to void
Move ( VpePreviewDocsp ( hDoc, mywinh ,1,9,12,VPE_SHOW_MAXIMIZED ) )

No errors are returned and the VpeSetPaper bin seems to be working fine.

However the first sheet is NOT coming out duplex I get two sheets instead.

I have read the note in the help about duplex mode begin reset and to only do it "between" pages.

I can't see how I should order these commands differently ?

Please advise on how I can get this to work is VPEPageBreak perhaps the wrong command ie should I be doing something to change "sides" ? although I cant see anything in the DLL help

Thanks in advance

Andrew
AndrewKennard
 
Posts: 4
Joined: Tue Jun 17, 2008 10:52 am

Postby IDEAL Software Support » Mon Jun 23, 2008 3:01 pm

You can specify the Duplex Mode once before printing. This mode is then valid for the whole print job.

If you wish to change the duplex mode during printing in the middle of a print job, you need to process the VPE_PRINT_NEWPAGE event. The event is sent while printing and exactly before a new page is printed. Your event-handler can then call VpeSetDevDuplex() as desired.

Please see also the description of the event in the help file titled "Reference".
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Postby AndrewKennard » Mon Jun 23, 2008 3:10 pm

Thanks for the prompt clarification
AndrewKennard
 
Posts: 4
Joined: Tue Jun 17, 2008 10:52 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 6 guests