These changes are in QRPrntr.pas.
All we are doing here is adding to the arrays of printer data.
THIS WILL CHANGE THE INTERFACE SECTION OF QRPRNTR, AND SO WILL LOSE
COMPATIBILITY WITH 3RD PARTY SOFTWARE.
// This is an enumerated type.
TQRBin = (First,
Upper,
Lower,
Middle,
Manual,
Envelope,
EnvManual,
Auto,
Tractor,
SmallFormat,
LargeFormat,
LargeCapacity,
Cassette,
Last);
// Further down the file is a constant array of integers
cQRBinTranslate : array[First..Last] of integer =
(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 14);
When you write the code -
quickrep1.qrprinter.outputbin := Lower;
the effect is to send a bin select code '2' to the printer when the
document starts.
The problem is when the code you want to send does not exist in the array
cQRBinTranslate.
You can easily check this by downloading this program which will show a printers codes.
The data shown is for a HP C LaserJet 4500-PS.
Clearly, NONE of these trays is accessible from the current array of codes.
The solution should now be obvious - place the new code in the arrays.
You can do this by over writing an existing code, or adding new types and codes
to the array.
NOTE : the first and last elements of TQRBin MUST be as is - i.e. 'First' and 'Last'.
Example :
// This is the new type array -
TQRBin = (First,
Upper,
Lower,
Middle,
Manual,
Envelope,
EnvManual,
Auto,
Tractor,
SmallFormat,
// LargeFormat, not used now
HPAuto, // a new type
LargeCapacity,
Cassette,
Last);
// One constant changed here ...
cQRBinTranslate : array[First..Last] of integer =
(1, 1, 2, 3, 4, 5, 6, 7, 8, 9, {12 not used} 15, 11, 14, 14);
Now you may write the Delphi code -
qrprinter.outputbin := HPAuto;
and expect it to work.
|