Bug 283437 [Postscript] If the page size is not set correctly, there will be a PostScript error "configurationerror".

Patch by leon.sha@sun.com.
kherron+mozilla: review+
roc: superreview+
This commit is contained in:
leon.sha%sun.com 2005-03-15 01:56:41 +00:00
parent ce53511c15
commit 0486acc879

View File

@ -460,13 +460,12 @@ nsPostScriptObj::write_prolog(FILE *aHandle, PRBool aFTPEnable)
// Tell the printer what size paper it should use
fprintf(f,
"/setpagedevice where\n" // Test for the feature
"{ pop\n"
" <<\n"
" /PageSize [ %s %s ]\n" // Paper dimensions
" /Policies <<\n"
" /PageSize 3\n" // Select the nearest page size to fit
" >>\n"
" >> setpagedevice\n" // Install settings
"{ pop 2 dict\n"
" dup /PageSize [ %s %s ] put\n" // Paper dimensions
" dup /Policies 1 dict\n"
" dup /PageSize 3 put\n" // Select the nearest page size to fit
" put\n"
" setpagedevice\n" // Install settings
"} if\n",
fpCString(NSTwipsToFloatPoints(paper_width)).get(),
fpCString(NSTwipsToFloatPoints(paper_height)).get());