Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #509
| From | Helge Blischke <h.blischke@acm.org> |
|---|---|
| Newsgroups | comp.lang.postscript |
| Subject | Re: ghostscript - any way to fit to printable area? |
| Followup-To | comp.lang.postscript |
| Date | 2011-12-16 18:12 +0100 |
| Message-ID | <9l1cglFes0U1@mid.individual.net> (permalink) |
| References | <78c19899-277e-4969-a8c0-9a2ae39c4036@n6g2000vbg.googlegroups.com> <jcdgb9$1hg$1@reader1.panix.com> <58aab8e2-b98f-41c3-8e8b-7fd4f7f2079c@i6g2000vbe.googlegroups.com> <aYmdnefEEM3j6HbTRVn_vwA@giganews.com> |
Followups directed to: comp.lang.postscript
John Reiser wrote:
>> We have around 500 blueprints
>
> Sometimes it is important for a blueprint to be actual size: the user
> intends to obtain valid data by measuring marks on the physical print.
> The external scale of the physical print must match the internal scale
> that was chosen by the author (human or program.)
>
> If so, then the only option for printing is positioning the output
> on the page, such as rotation or centering. The printer's 4mm hard
> margin may clip some marks, but with a requirement for "actual size"
> printing then you have no choice. Choosing "fit to printable area"
> and scaling by a factor of 0.97 might just be the *worst possible* output.
> Some engineering departments require that drawings have a drawn border
> (effectively, a *drawn* bounding box) whose dimensions are known,
> so that clipping and scaling can be detected.
>
>> we print each week using ghostscript or
>> gsprint. Most are us letter but some a4 and a few 11x17. The current
>> printer has 4mm hard margins on each side. Sometimes the printed
>> output gets clipped at these hard margins when printing with
>> ghostscript depending on how close the engineer drew to the edge of
>> the page. Adobe reader has an option "fit to printable area" that
>> takes the pdf and scales it up or down to fit within the hard
>> margins. This is what I am trying to do. How would I know which way
>> to scale the output and manipulate the origin? Can ghostscript figure
>> this out somehow?
>
> If the printer has a 4mm hard margin on the two sides that correspond
> to the PostScript origin, then move the origin out of the margin using
> something such as:
> -----
> /inch { 72 mul } bind def
> /mm { 25.4 div inch } bind def
>
> 4 mm 4 mm move
> -----
>
> Next comes the scaling. The bounding box of the marks on a PostScript
> page can be unknown, so assume that there is a DSC (Document Structuring
> Convention) comment "%%BoundingBox" which gives correct information.
> You need to know the current paper size, which might be in a device
> dictionary. Assume that the orientation ("portrait" or "landscape"
> rotation) has been chosen, and requires no further rotation.
>
> If you don't require equal scaling along both axes, then divide
> each paper extent (remember to subtract the hard margins) by the
> corresponding drawing extent (from the bounding box), and 'scale'
> by that much. To fit with equal scaling along both axes then take
> the minimum ratio and use that for both axes. For centering, move
> the origin parallel to the axis that did not get a tight fit. If
> the bounding box does not have the proper corner at the origin,
> then another 'move' will be required.
>
> --
Using PostScript code, you can determine the real bounding box by
clippath pathbbox
which gives the four coordinates determining the lower left and the upper
right corner of the printab le area.
Helge
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar
ghostscript - any way to fit to printable area? jhgrredbjhj <freakyacres@gmail.com> - 2011-12-15 09:08 -0800
Re: ghostscript - any way to fit to printable area? rodd@panix.com (Rod Dorman) - 2011-12-15 19:04 +0000
Re: ghostscript - any way to fit to printable area? jhgrredbjhj <freakyacres@gmail.com> - 2011-12-16 04:56 -0800
Re: ghostscript - any way to fit to printable area? John Reiser <jreiserfl@comcast.net> - 2011-12-16 08:44 -0800
Re: ghostscript - any way to fit to printable area? Helge Blischke <h.blischke@acm.org> - 2011-12-16 18:12 +0100
Re: ghostscript - any way to fit to printable area? jhgrredbjhj <freakyacres@gmail.com> - 2011-12-16 13:10 -0800
Re: ghostscript - any way to fit to printable area? ken <ken@spamcop.net> - 2011-12-16 17:31 +0000
Re: ghostscript - any way to fit to printable area? jhgrredbjhj <freakyacres@gmail.com> - 2011-12-16 13:11 -0800
csiph-web