-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
PSDraw.rectangle produces incorrect PostScript #6428
Copy link
Copy link
Closed
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.
Description
This code should draw a rectangle, but it produces a blank page:
from PIL import PSDraw
with open('output.ps', 'wb') as file:
ps = PSDraw.PSDraw(file)
ps.begin_document('TEST')
ps.rectangle((1 * 72, 4 * 72, 3 * 72, 2 * 72))
ps.end_document()I inspected the PostScript that it produced and it didn't make a whole lot of sense to me (I've worked with it in the past) until I realised that the parameters on the PostScript stack were in the wrong order.
The PostScript says "72 288 M 216 144 0 Vr" when it should say "72 288 M 0 216 144 Vr", i.e. it's "left top M width height 0 Vr" instead of "left top M 0 width height Vr".
When I edited the PostScript, I got the expected result.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugAny unexpected behavior, until confirmed feature.Any unexpected behavior, until confirmed feature.