antlr / antlr4-lab

A client/server for trying out and learning about ANTLR
MIT License
36 stars 11 forks source link

Parse tree image is cropped #34

Closed kaby76 closed 1 year ago

kaby76 commented 1 year ago

With the grammars-v4 update, I'm noticing most images are cropped. I traced this to the call to ps2pdf. The size of the image is not set for the call. The default of ps2pdf is to use the device characteristics for the server. We need to override that with the size of the PostScript image create.

The WritePS() call does not output the size of the image created. So, the file must be read, and the line that declares the image size used, e.g., %%BoundingBox: 0 0 3857 414. The values there need to be passed to the call to ps2pdf.

ps2pdf -dDEVICEWIDTHPOINTS=3857 -dDEVICEHEIGHTPOINTS=414 temp.ps temp.pdf
parrt commented 1 year ago

Ah! I saw and forgot to add issue. thanks! lemme check this out.