Where is the definition or documentation of PDF "default user spaceunits"?

Discussion in 'Perl Misc' started by Ted Byers, Mar 10, 2009.

  1. Ted Byers

    Ted Byers Guest

    Searching through the documentation for the PDF Perl packages'
    documentation, I found very terse mention of "default user space
    units", but I have yet to find what the default is, or how I can
    change it (or at least make a call that says the coordinates provided
    are in mm). To date, all my perl scripts that make PDF files use
    coordinates determined by trial and error, but I want to change this
    so I can just use coordinates in mm, or cm, and forget the tedium of
    rerunning the script seemingly countless times to get the position of
    text just right.

    Thanks

    Ted
    Ted Byers, Mar 10, 2009
    #1
    1. Advertising

  2. Re: Where is the definition or documentation of PDF "default userspace units"?

    Ted Byers wrote:
    > Searching through the documentation for the PDF Perl packages'
    > documentation, I found very terse mention of "default user space
    > units", but I have yet to find what the default is, or how I can
    > change it (or at least make a call that says the coordinates provided
    > are in mm). To date, all my perl scripts that make PDF files use
    > coordinates determined by trial and error, but I want to change this
    > so I can just use coordinates in mm, or cm, and forget the tedium of
    > rerunning the script seemingly countless times to get the position of
    > text just right.


    default units are 72dpi. I've never changed them, just used them.

    --
    -brian
    Brian Helterline, Mar 10, 2009
    #2
    1. Advertising

  3. Re: Where is the definition or documentation of PDF "default userspace units"?

    On Mar 10, 2:15 pm, Brian Helterline <> wrote:
    > Ted Byers wrote:
    > > Searching through the documentation for the PDF Perl packages'
    > > documentation, I found very terse mention of "default user space
    > > units", but I have yet to find what the default is, or how I can
    > > change it (or at least make a call that says the coordinates provided
    > > are in mm). To date, all my perl scripts that make PDF files use
    > > coordinates determined by trial and error, but I want to change this
    > > so I can just use coordinates in mm, or cm, and forget the tedium of
    > > rerunning the script seemingly countless times to get the position of
    > > text just right.

    >
    > default units are 72dpi.  I've never changed them, just used them.
    >
    > --
    > -brian


    Adobe offers the PDF manual for download.
    Or the postscript manual will give much of the same information
    (as far as the imaging model is concerned).

    Apropos FYI, the unit is just shy of a "standard" printer's
    point (72.27). So a 10pt font from a laserprinter is ever-so-
    slightly smaller than the 10pt letterpress fontface in your
    old Moby Dick.

    lxt
    luser-ex-troll, Mar 11, 2009
    #3
  4. Re: Where is the definition or documentation of PDF "default userspace units"?

    luser-ex-troll wrote:
    > On Mar 10, 2:15 pm, Brian Helterline <> wrote:
    >> Ted Byers wrote:
    >>> Searching through the documentation for the PDF Perl packages'
    >>> documentation, I found very terse mention of "default user space
    >>> units", but I have yet to find what the default is, or how I can
    >>> change it (or at least make a call that says the coordinates provided
    >>> are in mm). To date, all my perl scripts that make PDF files use
    >>> coordinates determined by trial and error, but I want to change this
    >>> so I can just use coordinates in mm, or cm, and forget the tedium of
    >>> rerunning the script seemingly countless times to get the position of
    >>> text just right.

    >> default units are 72dpi. I've never changed them, just used them.
    >>


    Default units are points.

    >
    > Adobe offers the PDF manual for download.
    > Or the postscript manual will give much of the same information
    > (as far as the imaging model is concerned).
    >
    > Apropos FYI, the unit is just shy of a "standard" printer's
    > point (72.27). So a 10pt font from a laserprinter is ever-so-
    > slightly smaller than the 10pt letterpress fontface in your
    > old Moby Dick.


    http://en.wikipedia.org/wiki/Point_(typography)

    http://nwalsh.com/comp.fonts/FAQ/cf_8.htm#SEC16

    --
    RGB
    RedGrittyBrick, Mar 11, 2009
    #4
  5. Ted Byers

    Ted Byers Guest

    Re: Where is the definition or documentation of PDF "default userspace units"?

    On Mar 10, 2:54 pm, Ted Byers <> wrote:
    > Searching through the documentation for the PDF Perl packages'
    > documentation, I found very terse mention of "default user space
    > units", but I have yet to find what the default is, or how I can
    > change it (or at least make a call that says the coordinates provided
    > are in mm). To date, all my perl scripts that make PDF files use
    > coordinates determined by trial and error, but I want to change this
    > so I can just use coordinates in mm, or cm, and forget the tedium of
    > rerunning the script seemingly countless times to get the position of
    > text just right.
    >
    > Thanks
    >
    > Ted


    Thanks guys.

    Knowing the default units are points is a start, providing familiar
    ground. It makes writing functions to convert from any other unit of
    length to points trivial. I am quite used to writing code in a number
    of languages to support real time animation, and to write code
    generated graphics to a variety of output devices including printers:
    all of which required explicit transformations from real world
    coordinates to device coordinates. However, the question is more
    about use of PDF::API2, and related packages, than it is about the PDF
    specification itself.

    Depending on where the author lived and worked, his "default user
    space units" could well have been inches, feet, millimeters, or
    centimeters. What was written in the documentation I referred to does
    not make even that clear.

    A colleague told me yesterday that the PHP PDF package he uses
    supports providing coordinates in millimeters, and naturally I looked
    into the Perl packages I use to see if they provide comparable
    functionality. The problem I encountered is one of salient
    information apparently not being provided in the documentation of
    functions and packages provided to create and edit PDF files. If they
    don't I can easily create it myself. But as you can understand, I
    would want to avoid recreating the wheel, and so would use the
    packages' functions if they do what I require.

    Thanks again,

    Ted
    Ted Byers, Mar 11, 2009
    #5
  6. Re: Where is the definition or documentation of PDF "default userspace units"?

    On Mar 11, 10:35 am, Ted Byers <> wrote:
    > On Mar 10, 2:54 pm, Ted Byers <> wrote:
    >
    > > Searching through the documentation for the PDF Perl packages'
    > > documentation, I found very terse mention of "default user space
    > > units", but I have yet to find what the default is, or how I can
    > > change it (or at least make a call that says the coordinates provided
    > > are in mm). To date, all my perl scripts that make PDF files use
    > > coordinates determined by trial and error, but I want to change this
    > > so I can just use coordinates in mm, or cm, and forget the tedium of
    > > rerunning the script seemingly countless times to get the position of
    > > text just right.

    >
    > > Thanks

    >
    > > Ted

    >
    > Thanks guys.
    >
    > Knowing the default units are points is a start, providing familiar
    > ground.  It makes writing functions to convert from any other unit of
    > length to points trivial.  I am quite used to writing code in a number
    > of languages to support real time animation, and to write code
    > generated graphics to a variety of output devices including printers:
    > all of which required explicit transformations from real world
    > coordinates to device coordinates.  However, the question is more
    > about use of PDF::API2, and related packages, than it is about the PDF
    > specification itself.
    >
    > Depending on where the author lived and worked, his "default user
    > space units" could well have been inches, feet, millimeters, or
    > centimeters.  What was written in the documentation I referred to does
    > not make even that clear.
    >
    > A colleague told me yesterday that the PHP PDF package he uses
    > supports providing coordinates in millimeters, and naturally I looked
    > into the Perl packages I use to see if they provide comparable
    > functionality.  The problem I encountered is one of salient
    > information apparently not being provided in the documentation of
    > functions and packages provided to create and edit PDF files.  If they
    > don't I can easily create it myself.  But as you can understand, I
    > would want to avoid recreating the wheel, and so would use the
    > packages' functions if they do what I require.
    >
    > Thanks again,
    >
    > Ted


    If you're using a toolchain that goes through Postscript,
    you can scale the coordinate system to inches

    72 72 scale

    or millimeters

    72 2.54 div 28.3465 scale
    or
    28.3465 dup scale

    I don't know the particulars of the various pdf
    generators, but this is a fundamental capability
    of the image model, hard-won in the desktop wars
    of the eighties.
    N.B. Transformations are often reset for each page.
    For multiple pages, you'll have to arrange to
    rescale on each one.

    lxt
    luser-ex-troll, Mar 12, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jianli Shen
    Replies:
    1
    Views:
    587
    Victor Bazarov
    Mar 13, 2005
  2. Ark
    Replies:
    1
    Views:
    416
    Chris Torek
    Aug 7, 2004
  3. Jon Slaughter
    Replies:
    4
    Views:
    449
    Jon Slaughter
    Oct 26, 2005
  4. Ricardo Pog
    Replies:
    1
    Views:
    422
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    366
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page