Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #2641
| From | ken <ken@spamcop.net> |
|---|---|
| Newsgroups | comp.lang.postscript |
| Subject | Re: PageSize v. BoundingBox |
| Date | 2016-06-10 17:22 +0100 |
| Message-ID | <MPG.31c4f97f90a819e989906@usenet.plus.net> (permalink) |
| References | <slrnnll8f1.5c2.peter@box8.pjb.com.au> |
In article <slrnnll8f1.5c2.peter@box8.pjb.com.au>, peter@www.pjb.com.au says... > > Hi. > currentpagedevice (PageSize) get == > prints out: > [594.672 841.829956] > i.e. A4 in point. Now if I add a: > %%BoundingBox: 0 0 75 37.5 > line, I would expect it to print [75 37.5] ; but it doesn't, gs > prints [594.672 841.829956] as before, which doesn't seem useful :-( As Carlos already pointed out, comments are just comments (any line beginning '%' is a comment), PostScript interpreters ignore comments. DSC comments are present for DSC parsers to handle, In particular they are used when an application imports an EPS into its content. If you want to alter the media size the you need the setpagedevice operator. Eg: <</PageSize [75 37.5]>> setpagedevice will request media which is 75x37.5 points (ie very small, approx 1 inch by half an inch). You can also use -dDEVICEWIDTHPOINTS and - dDEVICEHEIGHTPOINTS, the -g switch, and possibly some other ways that I've forgottten about. In short, there are lots of ways to set the media size, but comments aren't one of them. > Is there a way from within the code of finding the BoundingBox size? If your file is an EPS file then -dEPSCrop will crop the media to the declared BoundingBox. There is also a rudimentary DSC parser available in Ghostscript, you can find more about it in the documentation. If you want to know the actual bounding box of a random piece of PostScript you can use Ghostscript's bbox device which will tell you. Ken
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PageSize v. BoundingBox Peter Billam <peter@www.pjb.com.au> - 2016-06-10 11:17 +0000
Re: PageSize v. BoundingBox Carlos <angus@quovadis.com.ar> - 2016-06-10 15:00 +0200
Re: PageSize v. BoundingBox ken <ken@spamcop.net> - 2016-06-10 17:22 +0100
Re: PageSize v. BoundingBox Peter Billam <peter@www.pjb.com.au> - 2016-06-11 01:55 +0000
Re: PageSize v. BoundingBox Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-10 19:18 -0700
Re: PageSize v. BoundingBox Peter Billam <peter@www.pjb.com.au> - 2016-06-11 02:43 +0000
Re: PageSize v. BoundingBox jdaw1 <jdawiseman@gmail.com> - 2016-06-12 02:37 -0700
csiph-web