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:
rods%netscape.com
2002-05-16 14:20:04 +00:00
parent 9861f30e1d
commit b78558faa1
3 changed files with 17 additions and 1 deletions

View File

@@ -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___ */

View File

@@ -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));
}

View File

@@ -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];