Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Where is the definition or documentation of PDF "default user spaceunits"? (http://www.velocityreviews.com/forums/t909927-where-is-the-definition-or-documentation-of-pdf-default-user-spaceunits.html)

Ted Byers 03-10-2009 06:54 PM

Where is the definition or documentation of PDF "default user spaceunits"?
 
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

Brian Helterline 03-10-2009 07:15 PM

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

luser-ex-troll 03-11-2009 04:22 AM

Re: Where is the definition or documentation of PDF "default userspace units"?
 
On Mar 10, 2:15*pm, Brian Helterline <brian.helterl...@hp.com> 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

RedGrittyBrick 03-11-2009 12:01 PM

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

luser-ex-troll wrote:
> On Mar 10, 2:15 pm, Brian Helterline <brian.helterl...@hp.com> 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

Ted Byers 03-11-2009 03:35 PM

Re: Where is the definition or documentation of PDF "default userspace units"?
 
On Mar 10, 2:54*pm, Ted Byers <r.ted.by...@gmail.com> 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

luser-ex-troll 03-12-2009 06:29 AM

Re: Where is the definition or documentation of PDF "default userspace units"?
 
On Mar 11, 10:35*am, Ted Byers <r.ted.by...@gmail.com> wrote:
> On Mar 10, 2:54*pm, Ted Byers <r.ted.by...@gmail.com> 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


All times are GMT. The time now is 03:39 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.