Post by jhgrredbjhjWe 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.
Post by jhgrredbjhjwe 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.
--