Re: A4 to Letter conversion



In article <1156343526.534403.23200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
l00sap@xxxxxxx says...
I'm converting a PS file from A4 paper to Letter paper. I have code
that changes 595 and 842 (point size of a4-paper) to 612 and 792. This
works but I would like to scale the file properly. I came across this
code snippet for scaling. But not sure how to use it?

A4 to Letter
"26 0 translate .9397 dup scale"

scale takes two parameters, an x scale factor and a y scale factor. You
know the dimensions of letter (595x842) and you know the dimensions of
A4 (612x792) so all you need to do is apply a scale factor which maps
the x value 595 to 612 and the y value 842 to 792. For example:

612 595 div % x scale factor = 612/595 = 1.0286
792 842 div % y scale factor = 792/842 = 0.9406
scale % apply the scale factor

Because this is anamorphic scaling, you will get differences in the
output (circles will become ellipses for example). The scale you quote
simply scales *both* axes by a factor intended to make the letter fit on
A4, and offsets the origin to centre the letter on the A4 output.

Using this is more problematic, but if you have managed to change the
page size, then I suggest you insert this line immediately after theose
changes.


Ken
.



Relevant Pages

  • Re: 120dpi setting for windows and dynamic added controls
    ... The scaling example is fine. ... dependent on the Windows default font used for the UI, ... This method calculated the relative scale sizes from ... user controls would scale correctly ...
    (microsoft.public.dotnet.framework.windowsforms)
  • AffineTransformation (spell checked)
    ... I am trying to scale a series of vertices that have been selected on ... The vertices could be any place on the sphere, ... The scaling is set to 0.5f. ... pRotationCenter, ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Button doesnt have to resize when the screen resolution is changed
    ... isn't telling the truth about it and that breaks the scaling. ... same size on screen, but the pictures that we ... made for the buttons don't scale to fit the button's size. ... Fonts do scale because they are vector based for modern ...
    (comp.lang.tcl)
  • Re: Windows Forms: Control.Scale(SizeF) does not work?
    ... I had a similar problem understanding Scale. ... the dimensions of everything that one time, ... since they will all be created before the first layout, ... After scaling happens, the original components will have their height ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Scaling when using Newtons method for local optimization
    ... I know that scaling the problem is very important to get a ... A typical example of the Hessian is ... I simply scale the values back again. ... hence your setting of the scaled Hessian is o.k. ...
    (sci.math.num-analysis)