This project is read-only.

negative origins, calculation of bounding box

May 13, 2016 at 4:27 PM
Edited May 18, 2016 at 1:12 PM
Josip, once again, thx for that project.

I've an issue rendering some postscript code generated by Terry Burtons BWIPP implementation (http://bwipp.terryburton.co.uk/) of a ps barcode library.

Since ghostscript doesn't calculate negative values and crops them (see http://bugs.ghostscript.com/show_bug.cgi?id=202735) and my generated ps code originates at negative values I've to translate the ps coordinates to get the device and bounding-box coordinates..

is there an implementation in ghostscript.net (I currently use the rasterizer) to get the bounding boxes (ghostscript -sDEVICE=bbox)?

Update: maybe I'd run ghostscript processor 2 times, first time retrieving the bounding boxes (after translating the PS Code into positive coordinates), then running again with the calculated new boundaries. But how can I retrieve the Stdout of ghostscript.net.processor showing me the -sDevice=bbox Output, e.g.
%%HiResBoundingBox: 991.961970 995.885970 1105.743974 1071.719124
?

see: https://groups.google.com/d/msg/postscriptbarcode/ncfxg0Pc0iA/r0uRxcVRBQAJ

regards,

Ralf
May 18, 2016 at 2:58 PM
Another Update after some searching:

the ghostscript device -bbox writes its output to stderr instead of stdout. Is there a way to parse the stderr instead of stdout?

Ralf.