Skip navigation
Currently Being Moderated

PDF form field rectangle out of page coordinates

Jan 18, 2013 8:02 AM

Tags: #pdf/a #form_field

Hi,

 

recently i came across a PDF file which had a (text) form field with the following rectangle coordinates:

 

LowerLeft:  170;850

UpperRight: 475;862

 

The page itself had: 595;841 whereas MediaBox=CropBox=BleedBox=TrimBox.

 

Thus the y coordinate is out of the page so to speak.

The adobe reader displays the field at the upper top of the page but within the boundaries of the page.

Maybe it does correct/fix it?

 

My question is:

1.) Is that pdf spec compliant? (I did a quick search however couldn't find anything about it)

2.) Is that PDF/A-1 compliant (if that makes a difference)?

 

Thanks,

ToM

 
Replies
  • Currently Being Moderated
    Jan 18, 2013 8:08 AM   in reply to ToM_1st

    I'd like to see the PDF in question…

     

    But in general, the coordinates of fields DO NOT need to lie within page boundaries.  It is perfectly valid to have a field that it outside of the coordinates – in fact, it's a quite common way to show/hide fields by simply shifting the rect "offscreen".

     

    And there is nothing in PDF/A-1 (or 2 or 3) that would prohibit it.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 18, 2013 8:44 AM   in reply to ToM_1st

    There probably should be, but there aren't (AFAIK).  Right now, all such behaviors are up to the reader.

     

    Here is a PDF (<http://drops.pdfsages.com/UcC7>) that has some fields partially as well as completely offscreen.  See what happens…

     

    This issue is certainly something we can certainly raise in committee.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2013 4:29 AM   in reply to ToM_1st

    Yes, negative coords are perfectly valid.   Remember those are relative to the MediaBox, which doesn't have to be origined at (0,0)

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2013 7:08 AM   in reply to ToM_1st

    Only MediaBox.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2013 2:53 PM   in reply to lrosenth

    If CropBox is present it takes precedence in terms of which portion of the page description is shown (everything outside the CropBox is clipped). Only if the CopBox is not present,  the MediaBox will also act as the CropBox. The  perceived position of the form fields and annotations on the page is a result of their position in relationship to the area defined by the CropBox (or MediaBox, if no CropBox  is present).

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2013 2:48 AM   in reply to olafdruemmer

    Olaf – you are correct that what is VISIBLE is defined by the CropBox (if present).  However, ALL PAGE COORDINATES (both content and annotations/fields) are ALWAYS relative to the MediaBox.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2013 3:28 AM   in reply to lrosenth

    No, I think this is incorrect - all page coordinates are relative to the coordinate system:

     

    From ISO 32000-1, Table 164:

     

    Rect

    rectangle

    (Required) The annotation rectangle, defining the location of the annotation on the page in default user space units.

     

     

    Default user space is not relative to MediaBox or any other box.

     

    From ISO 32000-1, Table 30:

     

    MediaBox

    rectangle

    (Required; inheritable) A rectangle (see 7.9.5, "Rectangles"), expressed in default user space units, that shall define the boundaries of the physical medium on which the page shall be displayed or printed (see 14.11.2, "Page Boundaries").

     

     

    From ISO 32000-1, 8.3.2.3, User Space:

     

    The CropBox entry in the page dictionary shall specify the rectangle of user space corresponding to the visible area of the intended output medium (display window or printed page).

     

     

    Otherwise annotations and form fields would move just because someone is changing the MediaBox or CropBox values...

     

    Olaf

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2013 4:03 AM   in reply to olafdruemmer

    Annotations DO move if you change the MediaBox, but will NOT move if you change the CropBox.   Try it

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2013 6:16 AM   in reply to lrosenth

    Ah, but if you change the MediaBox bottom left, then you are changing the effective co-ordinates of the page, so the annotations will move relative to that. Indeed, if annotations were relative to the media box bottom left, then changing the media box bottom left would leave the annotations in place. And it doesn't.

     

    I think I'd say:

    Annotations, MediaBox, CropBox, other boxes are all measured relative to the same origin, which may be within, at the edge of, or outside the visible page. This is also the origin of the co-ordinate system used in page content. Measurements are not relative to the visible page, but will coincide if the visible page bottom left is at the origin.

     

    The term " in default user space units" is a bit unhelpful. The units clearly defines the size of a unit square, but does it define the origin?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2013 7:05 AM   in reply to Test Screen Name

    No they won't, because the coordinates of the fields are RELATIVE to the MediaBox origin – NOT absolute.   And yes, changing the origin (bottom/left) of the MediaBox will keep the annotations visually at the same place (relative to content).

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2013 1:44 AM   in reply to ToM_1st

    Acrobat doesn't have low level tools for inspecting things like this (there are add-ons). However, the Crop Pages dialog shows you what it calls the CropBox. This is defined by margins rather than being a rectangle. In fact it isn't always the same as the actual stored value, since the page Rotate value is applied first. However, for the ordinary user (rather than the PDF developer) what it does is the correct and intuitive thing.

     

    To find out the media box, set the crop values all to zero. The crop and media box will be the same.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points