PrJobMerge
PrJobMerge Copy data from one print record to an other
#include <PrintTraps.h> Printing Manager
void PrJobMerge(hPrtRecSrc, hPrtRecDest );
THPrint hPrtRecSrc ; handle leading to source TPrint structure
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.
Returns: none; call PrError for result code.

Notes: PrJobMerge first validates both print records (PrValidate) and then
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
CountAppFiles and GetAppFiles for related information). The idea is
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 */
void NewPrJobMerge(THPrint, THPrint);
void NewPrJobMerge(THPrint hPrintSrc, THPrint hPrintDst)
{
THPrint hPrintTemp;
OSErr copyError;
hPrintTemp = hPrintSrc; /* make copy of the print record handle */
copyError = HandToHand((Handle)hPrintTemp);
PrSetError(copyError ); /* so we can get it later*/
if (copyError == noErr) {
/* hPrintTemp is now a copy of the original source record */
PrJobMerge(hPrintTemp, hPrintDst);
/* messes up hPrintTemp , but we don't care */
}
if (hPrintTemp != nil)
DisposHandle((Handle)hPrintTemp); /* only a copy! */
}