Change the bin

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Change the bin

Postby Frigyes » Thu Jun 29, 2006 12:40 pm

Hi!

I try to change the Paper bin, but no chance with my code like:

Code: Select all
char s[256];

VpeSetPrintOptions(hDoc, PRINT_ALL  + PRINT_NO_AUTO_PAGE_DIMS);
int count = VpeDevEnumPaperBins(hDoc) - 1;
int li;

for ( li = 0; li < count; li++) {
   _itoa(li,s,10);
   VpeWriteBox(hDoc,100,(li * 100) + 100,-1,-1,s );
   VpeGetDevPaperBinName(hDoc, li, s, sizeof(s));
   VpeWriteBox(hDoc,200,(li * 100) + 100,-1,-1,s );
};


 VpeSetPaperBin(hDoc, 3);
 VpeWriteBox(hDoc,1100,100,-1,-1,"Fach 1" );
 VpePageBreak(hDoc);
 VpeSetPaperBin(hDoc, 4);
 VpeWriteBox(hDoc,100,100,-1,-1,"Fach 2" );
 VpePageBreak(hDoc);
 VpeSetPaperBin(hDoc, 5);
 VpeWriteBox(hDoc,100,100,-1,-1,"Fach 3" );
 VpePageBreak(hDoc);


should this work? what´s wrong?


Any suggestions would be appreciated.

Thanks,


Frigyes


VPE DLL 3.60
Laserjet HP 2430i
the driver (with word) can change the bin
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm

Postby IDEAL Software Support » Mon Jul 03, 2006 11:01 am

You are enumerating the bins, but afterwards you are using constants to set the bin, instead of using a BIN-ID. Call VpeGetDevPaperBinID() to retrieve correct BIN-ID's.

Furthermore your code has a bug:

Code: Select all
int count = VpeDevEnumPaperBins(hDoc) - 1;


is wrong. It must read:

Code: Select all
int count = VpeDevEnumPaperBins(hDoc);


since your for-loop uses a "<" comparator.

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

Postby Frigyes » Mon Jul 03, 2006 12:04 pm

Hi!

It's works, many thanks

Regards
Frigyes

Code: Select all
 VpeSetPaperBin(hDoc, VpeGetDevPaperBinID(hDoc,3));
 VpeWriteBox(hDoc,100,100,-1,-1,"Fach 1" );
 VpePageBreak(hDoc);
 VpeSetPaperBin(hDoc, VpeGetDevPaperBinID(hDoc,4));
 VpeWriteBox(hDoc,100,100,-1,-1,"Fach 2" );
 VpePageBreak(hDoc);
 VpeSetPaperBin(hDoc, VpeGetDevPaperBinID(hDoc,5));
 VpeWriteBox(hDoc,100,100,-1,-1,"Fach 3" );
 VpePageBreak(hDoc);
Frigyes
 
Posts: 26
Joined: Thu Jun 29, 2006 12:09 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 27 guests

cron