Closed Bug 322621 Opened 19 years ago Closed 19 years ago

Mozilla generates broken postscript

Categories

(Core :: Printing: Output, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: nshmyrev, Assigned: kherron+mozilla)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4
Build Identifier: Mozilla PostScript module (rv:1.8/2005120220)

The problem is described here:

http://bugzilla.gnome.org/show_bug.cgi?id=325919

The attached postscript file that was generated by mozilla is broken and cause troubles. The reason is:

The document is not correctly printed. By specs,
postscript document must have the following layout:

......
%%BeginProlog
%%BeginResource
%%EndResource
%%EndProlog
%%BeginPage
....

But this one has:

......
%%BeginProlog
%%EndProlog
%%BeginResource
%%EndResource
%%BeginPage
....

So this document is broken, that is the reason of incorrect rendering.


Reproducible: Always

Steps to Reproduce:
Assignee: general → printing
Component: General → Printing
Product: Mozilla Application Suite → Core
QA Contact: general
Version: unspecified → 1.7 Branch
Confirming. Patch coming up.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: printing → kherron+mozilla
Status: ASSIGNED → NEW
Attached patch DSC cleanupSplinter Review
I can't reproduce this on my system, mostly because evince isn't saving its position in the document between invocations. But the assertion about how the DSC tags should be ordered is correct. This patch defers printing the EndProlog tag until after all the font data is written. While I was at it, I made a pass through the DSC spec and did some other cleanup.

The PostScript section to set the paper size properly belongs in the document script rather than the header, enclosed in BeginSetup/EndSetup, so I moved it from |write_prolog()| to |write_script()|. This meant cleaning up how the paper dimensions were being stored. Previously, the stored paper width & height were swapped for landscape printouts, which was pointless because every place they were being used they had to be swapped back.

I also added resource tags around the boilerplate procedures and around the old AFM font support. The AFM support wasn't all in the same place, so some of the C++ code to emit it had to be moved around. Some of this AFM code was being added to every print job whether it was needed or not, so this reorganization will be a benefit to non-AFM print jobs.
Attachment #207928 - Flags: review?
Attachment #207928 - Flags: review? → review?(cbiesinger)
Status: NEW → ASSIGNED
Version: 1.7 Branch → Trunk
Attachment #207928 - Flags: review?(cbiesinger) → review?(tor)
Attachment #207928 - Flags: review?(tor) → review+
Attachment #207928 - Flags: superreview?(roc)
Attachment #207928 - Flags: superreview?(roc) → superreview+
Patch checked in:

Checking in gfx/src/ps/nsPostScriptObj.cpp;
/cvsroot/mozilla/gfx/src/ps/nsPostScriptObj.cpp,v  <--  nsPostScriptObj.cpp
new revision: 1.127; previous revision: 1.126
done
Checking in gfx/src/ps/nsPostScriptObj.h;
/cvsroot/mozilla/gfx/src/ps/nsPostScriptObj.h,v  <--  nsPostScriptObj.h
new revision: 1.48; previous revision: 1.47
done

Resolving FIXED.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: