PrJobMerge
PrJobMerge
Copy data from one print record to an other THPrint hPrtRecDest ; handle leading to destination TPrint structure PrJobMerge is handy when you wish to print more than one document using details specified in a single call to PrJobDialog. It duplicates information from one print record to an other.
hPrtRecSrc is a handle leading to a 120-byte TPrint structure. This is typically a handle used in a previous call to PrStlDialog and hPrtRecDest is a handle leading to a TPrint structure. This is typically a handle used in a previous call to PrintDefault or a structure created from data stored in the document. A subset of the data in hPrtRecSrc is
copied into this structure.
copies a subset of the data from hPrtRecSrc into hPrtRecDest (the copied
data consists of the fields that can be changed by a call to PrJobDialog). The fields that are changed are not documented.
You might use this call when your application gets a list of documents to
print (as when the user selects "Print" from the Finder's "File"menu - see
to let the user specify parameters for all print jobs by handling a single
dialog.
Apple has documented in the Technical Notes some problems with
PrJobMerge as implemented by versions 7.0 and 7.1 of the LaserWriter driver. The driver does not correctly merge all job-related data into the
destination print record; as a result it cannot print multiple copies of
multiple documents from the Finder.
In addition, it destroys the job-specific information in the source print
record after failing to copy it into the destination record. The workaround
for this is to make a copy of the source print record and pass it to
PrJobMerge, which you have replaced with your own routine that makes a copy, merges it into the destination, and disposes of the copy. Don't go
overboard writing your own PrJobMerge function, or you will run into compatibility problems down the road. A routine like this will still behave
properly after the bug is fixed:
#include <PrintTraps.h>
/* prototype your function like this prior to calling it */
{
hPrintTemp = hPrintSrc; /* make copy of the print record handle */
PrSetError(copyError ); /* so we can get it later*/ if (copyError == noErr) {
/* hPrintTemp is now a copy of the original source record */
/* messes up hPrintTemp , but we don't care */
}
if (hPrintTemp != nil)
}