Package com.pd4ml.pdf.cos.util
Class PageAttributes
- java.lang.Object
-
- com.pd4ml.pdf.cos.util.PageAttributes
-
public final class PageAttributes extends java.lang.ObjectWalks a page dictionary's/Parentchain for an "inheritable" page attribute --/MediaBox,/CropBox,/Resources(ISO 32000-1 7.7.3.4, Table 30) -- that the page itself doesn't declare.PageTreeonly navigates/Kidsdownward (find/count pages); nothing existing walked/Parentupward for this, so this fills that gap.Each attribute is looked up independently: a page can perfectly validly inherit
/MediaBoxfrom one ancestor level while declaring its own/CropBox, or vice versa -- callers must not assume "found MediaBox at level N" implies anything about where CropBox/Resources come from.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static COSBasegetInherited(COSDictionary page, java.lang.String key)static COSArraygetInheritedArray(COSDictionary page, java.lang.String key)Convenience for array-valued attributes (/MediaBox,/CropBox).static COSDictionarygetInheritedResources(COSDictionary page)Convenience for/Resourcesspecifically (dictionary-valued).
-
-
-
Method Detail
-
getInherited
public static COSBase getInherited(COSDictionary page, java.lang.String key)
- Returns:
- the first non-null value of
keyfound starting atpageitself and walking up through/Parent, ornullif neither the page nor any ancestor up to the/Pagesroot declares it.
-
getInheritedArray
public static COSArray getInheritedArray(COSDictionary page, java.lang.String key)
Convenience for array-valued attributes (/MediaBox,/CropBox).
-
getInheritedResources
public static COSDictionary getInheritedResources(COSDictionary page)
Convenience for/Resourcesspecifically (dictionary-valued).
-
-