Allows for printed more than one copy for the postscript print module
Bug 139566 r=roland sr=attinasi adt=petterman a=chofmann,dbaron,valeski git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@121626 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -163,6 +163,15 @@ public:
|
||||
* Returns W/H in Twips from Paper Size H/W
|
||||
*/
|
||||
NS_IMETHOD GetPageSizeInTwips(PRInt32 *aWidth, PRInt32 *aHeight) = 0;
|
||||
|
||||
/*
|
||||
* Return number of copies to print
|
||||
* @update
|
||||
* @param aCopies
|
||||
* @return
|
||||
*/
|
||||
NS_IMETHOD GetCopies ( int &aCopies ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif /* !nsIDeviceContextSpecPS_h___ */
|
||||
|
||||
@@ -316,6 +316,7 @@ nsPostScriptObj::Init( nsIDeviceContextSpecPS *aSpec )
|
||||
mPrintSetup->deep_color = PR_TRUE; // 24 bit color output
|
||||
mPrintSetup->reverse = 0; // Output order, 0 is acsending
|
||||
if ( aSpec != nsnull ) {
|
||||
aSpec->GetCopies(mPrintSetup->num_copies);
|
||||
aSpec->GetGrayscale( isGray );
|
||||
if ( isGray == PR_TRUE ) {
|
||||
mPrintSetup->color = PR_FALSE;
|
||||
@@ -2004,7 +2005,12 @@ FILE *f;
|
||||
|
||||
f = mPrintContext->prSetup->out;
|
||||
fprintf(f, "%%%%Page: %d %d\n", mPageNumber, mPageNumber);
|
||||
fprintf(f, "%%%%BeginPageSetup\n/pagelevel save def\n");
|
||||
fprintf(f, "%%%%BeginPageSetup\n");
|
||||
if(mPrintSetup->num_copies != 1) {
|
||||
fprintf(f, "1 dict dup /NumCopies %d put setpagedevice\n",
|
||||
mPrintSetup->num_copies);
|
||||
}
|
||||
fprintf(f,"/pagelevel save def\n");
|
||||
if (mPrintContext->prSetup->landscape){
|
||||
fprintf(f, "%d 0 translate 90 rotate\n",PAGE_TO_POINT_I(mPrintContext->prSetup->height));
|
||||
}
|
||||
|
||||
@@ -221,6 +221,7 @@ struct PrintSetup_ {
|
||||
void* carg; /* Data saved for completion routine */
|
||||
int status; /* Status of URL on completion */
|
||||
const char *print_cmd; /* print command */
|
||||
int num_copies; /* Number of copies of job to print */
|
||||
|
||||
/* "other" font is for encodings other than iso-8859-1 */
|
||||
char *otherFontName[N_FONTS];
|
||||
|
||||
Reference in New Issue
Block a user