Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

[RT 130039] mention how to *get* the global mediabox

  • 2 Replies
  • 104 Views
*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 587
    • View Profile
[RT 130039] mention how to *get* the global mediabox
« July 11, 2019, 02:23:09 PM »
Wed Jul 10 22:00:46 2019 jidanni [...] jidanni.org - Ticket created

We read $pdf->mediabox($llx, $lly, $urx, $ury) Sets the global mediabox. OK, but also mention how to *get* the global mediabox. E.g., "what is the current height?"

Thu Jul 11 13:55:07 2019 PMPERRY [...] cpan.org - Correspondence added

See 124915 (resolved bugs).

[Before closing as duplicate, check if documentation (POD) could be clarified.]

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 587
    • View Profile
Re: [RT 130039] mention how to *get* the global mediabox
« Reply #1: July 16, 2019, 03:05:46 PM »
Tue Jul 16 11:52:09 2019 steve [...] deefs.net - Correspondence added

There wasn't actually a method for getting the global boundary boxes, as it turns out.  The closest you could get was to call get_mediabox on a page, which would default to the global mediabox if it hadn't been overridden.

I've just updated mediabox, cropbox, bleedbox, trimbox, and artbox to do both getting and setting at both the PDF and page level.

[so is NOT quite a duplicate... fix adds global query, not just page]

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 587
    • View Profile
Re: [RT 130039] mention how to *get* the global mediabox
« Reply #2: August 04, 2019, 05:00:28 PM »
In a similar vein to PDF::API2, updates to global and page bounding box set and get methods. For both, a call without arguments returns the current bounding box of that type, and the get_* page functions have been deprecated. These changes will be in the 3.016 release.

I'm not sure if the PDF::API2 will "get" exactly the same boxes as does PDF::Builder. Through experimentation, it turns out that a page's boxes inherit from the global settings, and not locally from Media to Crop to the other boxes. That's how PDF::Builder set up the search hierarchy.