Previous Next


                                                    744
    CHAPTER 8                                                          Interactive Features



8.8 Measurement Properties

    PDF documents, such as those created by CAD software, may contain graphics
    that are intended to represent real-world objects. Users of such documents often
    require information about the scale and units of measurement of the correspond-
    ing real-world objects and their relationship to units in PDF user space.

    This information enables users of viewer applications to perform measurements
    that yield results in the units intended by the creator of the document. A mea-
    surement in this context is the result of a canonical function that takes as input a
    set of n coordinate pairs
    { ( x 0, y 0 ), …, ( x n – 1, y n – 1 ) }

    and produces a single number as output depending on the type of measurement.
    For example, distance measurement is equivalent to
    n–2

    ∑       ( xi – xi + 1 ) 2 + ( yi – yi + 1 ) 2
    i=0

    for n ≥ 2.

    Beginning with PDF 1.6, such information may be stored in a measure dictionary
    (see Table 8.110). Measure dictionaries provide information about measurement
    units associated with a rectangular area of the document known as a viewport.

    A viewport (PDF 1.6) is a rectangular region of a page. The optional VP entry in a
    page dictionary (see Table 3.27) specifies an array of viewport dictionaries, whose
    entries are shown in Table 8.109. Viewports allow different measurement scales
    (specified by the Measure entry) to be used in different areas of a page, if necessary.

    The dictionaries in the VP array are in drawing order. Since viewports might
    overlap, to determine the viewport to use for any point on a page, the dictionaries
    in the array are examined, starting with the last one and iterating in reverse, and
    the first one whose BBox entry contains the point is chosen.

    Note: Any measurement that potentially involves multiple viewports, such as one
    specifying the distance between two points, should use the information specified in
    the viewport of the first point.

Previous Next