pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1536136 [1/2] - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox: cos/ pdmodel/ pdmodel/documentinterchange/logicalstructure/ pdmodel/graphics/xobject/ pdmodel/interactive/annotation/ util/
Date Sun, 27 Oct 2013 13:59:25 GMT
Author: lehmi
Date: Sun Oct 27 13:59:24 2013
New Revision: 1536136

URL: http://svn.apache.org/r1536136
Log:
PDFBOX-1342: added support for merging tagged pdfs as proposed by Gerhard Temper

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObject.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObjectForm.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java?rev=1536136&r1=1536135&r2=1536136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSName.java Sun Oct 27 13:59:24 2013
@@ -25,40 +25,37 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.pdfbox.exceptions.COSVisitorException;
 import org.apache.pdfbox.persistence.util.COSHEXTable;
 
-
 /**
  * This class represents a PDF named object.
- *
+ * 
  * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
- * @version $Revision: 1.42 $
+ * 
  */
 public final class COSName extends COSBase implements Comparable<COSName>
 {
     /**
-     * Note: This is a ConcurrentHashMap because a HashMap must be synchronized if accessed by
-     * multiple threads.
+     * Note: This is a ConcurrentHashMap because a HashMap must be synchronized if accessed by multiple threads.
      */
     private static Map<String, COSName> nameMap = new ConcurrentHashMap<String, COSName>(8192);
 
     /**
-     * All common COSName values are stored in a simple HashMap. They are already defined as
-     * static constants and don't need to be synchronized for multithreaded environments.
+     * All common COSName values are stored in a simple HashMap. They are already defined as static constants and don't
+     * need to be synchronized for multithreaded environments.
      */
-    private static Map<String, COSName> commonNameMap =
-        new HashMap<String, COSName>();
+    private static Map<String, COSName> commonNameMap = new HashMap<String, COSName>();
 
     /**
      * A common COSName value.
      */
-    public static final COSName A = new COSName( "A" );
+    public static final COSName A = new COSName("A");
     /**
      * A common COSName value.
      */
-    public static final COSName AA = new COSName( "AA" );
+    public static final COSName AA = new COSName("AA");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ACRO_FORM = new COSName( "AcroForm" );
+     * A common COSName value.
+     */
+    public static final COSName ACRO_FORM = new COSName("AcroForm");
     /**
      * A common COSName value.
      */
@@ -66,7 +63,7 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName AIS = new COSName( "AIS" );
+    public static final COSName AIS = new COSName("AIS");
     /**
      * A common COSName value.
      */
@@ -76,21 +73,21 @@ public final class COSName extends COSBa
      */
     public static final COSName ALTERNATE = new COSName("Alternate");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ANNOT = new COSName( "Annot" );
+     * A common COSName value.
+     */
+    public static final COSName ANNOT = new COSName("Annot");
     /**
      * A common COSName value.
      */
-    public static final COSName ANNOTS = new COSName( "Annots" );
+    public static final COSName ANNOTS = new COSName("Annots");
     /**
      * A common COSName value.
      */
-    public static final COSName ANTI_ALIAS = new COSName( "AntiAlias" );
+    public static final COSName ANTI_ALIAS = new COSName("AntiAlias");
     /**
      * A common COSName value.
      */
-    public static final COSName AP_REF = new COSName( "APRef" );
+    public static final COSName AP_REF = new COSName("APRef");
     /**
      * A common COSName value.
      */
@@ -98,19 +95,19 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName ART_BOX = new COSName("ArtBox" );
+    public static final COSName ART_BOX = new COSName("ArtBox");
     /**
-    * A common COSName value.
-    */
-    public static final COSName AS = new COSName( "AS" );
+     * A common COSName value.
+     */
+    public static final COSName AS = new COSName("AS");
     /**
      * A common COSName value.
      */
-    public static final COSName ASCII85_DECODE = new COSName( "ASCII85Decode" );
+    public static final COSName ASCII85_DECODE = new COSName("ASCII85Decode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ASCII85_DECODE_ABBREVIATION = new COSName( "A85" );
+     * A common COSName value.
+     */
+    public static final COSName ASCII85_DECODE_ABBREVIATION = new COSName("A85");
     /**
      * A common COSName value.
      */
@@ -118,100 +115,100 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName ASCENT = new COSName( "Ascent" );
+    public static final COSName ASCENT = new COSName("Ascent");
     /**
      * A common COSName value.
      */
-    public static final COSName ASCII_HEX_DECODE = new COSName( "ASCIIHexDecode" );
+    public static final COSName ASCII_HEX_DECODE = new COSName("ASCIIHexDecode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ASCII_HEX_DECODE_ABBREVIATION = new COSName( "AHx" );
+     * A common COSName value.
+     */
+    public static final COSName ASCII_HEX_DECODE_ABBREVIATION = new COSName("AHx");
 
     /**
      * A common COSName value.
      */
-    public static final COSName AP = new COSName( "AP" );
+    public static final COSName AP = new COSName("AP");
     /**
      * A common COSName value.
      */
-    public static final COSName APP = new COSName( "App" );
+    public static final COSName APP = new COSName("App");
 
     /**
      * A common COSName value.
      */
-    public static final COSName AUTHOR = new COSName( "Author" );
+    public static final COSName AUTHOR = new COSName("Author");
 
     /**
      * A common COSName value.
      */
-    public static final COSName AVG_WIDTH = new COSName( "AvgWidth" );
+    public static final COSName AVG_WIDTH = new COSName("AvgWidth");
 
     /**
      * A common COSName value.
      */
-    public static final COSName B = new COSName( "B" );
+    public static final COSName B = new COSName("B");
     /**
-    * A common COSName value.
-    */
-    public static final COSName BACKGROUND = new COSName( "Background" );
+     * A common COSName value.
+     */
+    public static final COSName BACKGROUND = new COSName("Background");
     /**
-    * A common COSName value.
-    */
-    public static final COSName BASE_ENCODING = new COSName( "BaseEncoding" );
+     * A common COSName value.
+     */
+    public static final COSName BASE_ENCODING = new COSName("BaseEncoding");
     /**
-    * A common COSName value.
-    */
-    public static final COSName BASE_FONT = new COSName( "BaseFont" );
+     * A common COSName value.
+     */
+    public static final COSName BASE_FONT = new COSName("BaseFont");
 
     /** the COSName for "BaseState". */
-    public static final COSName BASE_STATE = new COSName( "BaseState" );
+    public static final COSName BASE_STATE = new COSName("BaseState");
 
     /**
      * A common COSName value.
      */
-    public static final COSName BBOX = new COSName( "BBox" );
+    public static final COSName BBOX = new COSName("BBox");
     /**
      * A common COSName value.
      */
-    public static final COSName BLACK_IS_1 = new COSName( "BlackIs1" );
+    public static final COSName BLACK_IS_1 = new COSName("BlackIs1");
     /**
      * A common COSName value.
      */
-    public static final COSName BLACK_POINT = new COSName( "BlackPoint" );
+    public static final COSName BLACK_POINT = new COSName("BlackPoint");
 
     /**
      * A common COSName value.
      */
-    public static final COSName BLEED_BOX = new COSName("BleedBox" );
+    public static final COSName BLEED_BOX = new COSName("BleedBox");
     /**
      * A common COSName value.
      */
-    public static final COSName BITS_PER_COMPONENT = new COSName("BitsPerComponent" );
+    public static final COSName BITS_PER_COMPONENT = new COSName("BitsPerComponent");
     /**
      * A common COSName value.
      */
-    public static final COSName BITS_PER_COORDINATE = new COSName("BitsPerCoordinate" );
+    public static final COSName BITS_PER_COORDINATE = new COSName("BitsPerCoordinate");
     /**
      * A common COSName value.
      */
-    public static final COSName BITS_PER_FLAG = new COSName("BitsPerFlag" );
+    public static final COSName BITS_PER_FLAG = new COSName("BitsPerFlag");
     /**
      * A common COSName value.
      */
-    public static final COSName BITS_PER_SAMPLE = new COSName("BitsPerSample" );
+    public static final COSName BITS_PER_SAMPLE = new COSName("BitsPerSample");
     /**
      * A common COSName value.
      */
-    public static final COSName BOUNDS = new COSName("Bounds" );
+    public static final COSName BOUNDS = new COSName("Bounds");
     /**
      * A common COSName value.
      */
-    public static final COSName BPC = new COSName("BPC" );
+    public static final COSName BPC = new COSName("BPC");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CATALOG = new COSName( "Catalog" );
+     * A common COSName value.
+     */
+    public static final COSName CATALOG = new COSName("Catalog");
     /**
      * A common COSName value.
      */
@@ -219,216 +216,216 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName C0 = new COSName( "C0" );
+    public static final COSName C0 = new COSName("C0");
     /**
      * A common COSName value.
      */
-    public static final COSName C1 = new COSName( "C1" );
+    public static final COSName C1 = new COSName("C1");
     /**
      * A common COSName value.
      */
-    public static final COSName CA = new COSName( "CA" );
+    public static final COSName CA = new COSName("CA");
     /**
      * A common COSName value.
      */
-    public static final COSName CA_NS = new COSName( "ca" );
+    public static final COSName CA_NS = new COSName("ca");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CALGRAY = new COSName( "CalGray" );
+     * A common COSName value.
+     */
+    public static final COSName CALGRAY = new COSName("CalGray");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CALRGB = new COSName( "CalRGB" );
+     * A common COSName value.
+     */
+    public static final COSName CALRGB = new COSName("CalRGB");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName CAP_HEIGHT = new COSName("CapHeight");
     /**
      * A common COSName value.
      */
-    public static final COSName CAP_HEIGHT = new COSName( "CapHeight" );
+    public static final COSName CCITTFAX_DECODE = new COSName("CCITTFaxDecode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CCITTFAX_DECODE = new COSName( "CCITTFaxDecode" );
+     * A common COSName value.
+     */
+    public static final COSName CCITTFAX_DECODE_ABBREVIATION = new COSName("CCF");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CCITTFAX_DECODE_ABBREVIATION = new COSName( "CCF" );
+     * A common COSName value.
+     */
+    public static final COSName CENTER_WINDOW = new COSName("CenterWindow");
     /**
      * A common COSName value.
      */
-    public static final COSName CENTER_WINDOW = new COSName( "CenterWindow" );
+    public static final COSName CF = new COSName("CF");
     /**
      * A common COSName value.
      */
-    public static final COSName CF = new COSName( "CF" );
+    public static final COSName CFM = new COSName("CFM");
     /**
      * A common COSName value.
      */
-    public static final COSName CFM = new COSName( "CFM" );
+    public static final COSName CHAR_PROCS = new COSName("CharProcs");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CHAR_PROCS = new COSName( "CharProcs" );
+     * A common COSName value.
+     */
+    public static final COSName CHAR_SET = new COSName("CharSet");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CHAR_SET = new COSName( "CharSet" );
+     * A common COSName value.
+     */
+    public static final COSName CID_FONT_TYPE0 = new COSName("CIDFontType0");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CID_FONT_TYPE0 = new COSName( "CIDFontType0" );
+     * A common COSName value.
+     */
+    public static final COSName CID_FONT_TYPE2 = new COSName("CIDFontType2");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CID_FONT_TYPE2 = new COSName( "CIDFontType2" );
+     * A common COSName value.
+     */
+    public static final COSName CIDSYSTEMINFO = new COSName("CIDSystemInfo");
     /**
-    * A common COSName value.
-    */
-    public static final COSName CIDSYSTEMINFO = new COSName( "CIDSystemInfo" );
+     * A common COSName value.
+     */
+    public static final COSName CID_TO_GID_MAP = new COSName("CIDToGIDMap");
     /**
      * A common COSName value.
      */
-    public static final COSName CID_TO_GID_MAP = new COSName( "CIDToGIDMap" );
+    public static final COSName COLORANTS = new COSName("Colorants");
     /**
      * A common COSName value.
      */
-    public static final COSName COLORANTS = new COSName( "Colorants" );
+    public static final COSName COLORS = new COSName("Colors");
     /**
      * A common COSName value.
      */
-    public static final COSName COLORS = new COSName( "Colors" );
+    public static final COSName COLORSPACE = new COSName("ColorSpace");
     /**
      * A common COSName value.
      */
-    public static final COSName COLORSPACE = new COSName( "ColorSpace" );
+    public static final COSName COLUMNS = new COSName("Columns");
     /**
      * A common COSName value.
      */
-    public static final COSName COLUMNS = new COSName( "Columns" );
+    public static final COSName CONTACT_INFO = new COSName("ContactInfo");
     /**
      * A common COSName value.
      */
-    public static final COSName CONTACT_INFO = new COSName( "ContactInfo" );
+    public static final COSName CONTENTS = new COSName("Contents");
     /**
      * A common COSName value.
      */
-    public static final COSName CONTENTS = new COSName( "Contents" );
-     /**
-      * A common COSName value.
-      */
-    public static final COSName COORDS = new COSName( "Coords" );
+    public static final COSName COORDS = new COSName("Coords");
     /**
-    * A common COSName value.
-    */
-    public static final COSName COUNT = new COSName( "Count" );
+     * A common COSName value.
+     */
+    public static final COSName COUNT = new COSName("Count");
     /**
      * A common COSName value.
      */
-    public static final COSName CLR_F = new COSName( "ClrF" );
+    public static final COSName CLR_F = new COSName("ClrF");
     /**
      * A common COSName value.
      */
-    public static final COSName CLR_FF = new COSName( "ClrFf" );
+    public static final COSName CLR_FF = new COSName("ClrFf");
     /**
      * A common COSName value.
      */
-    public static final COSName CREATION_DATE = new COSName( "CreationDate" );
+    public static final COSName CREATION_DATE = new COSName("CreationDate");
     /**
      * A common COSName value.
      */
-    public static final COSName CREATOR = new COSName( "Creator" );
+    public static final COSName CREATOR = new COSName("Creator");
     /**
      * A common COSName value.
      */
-    public static final COSName CROP_BOX = new COSName(  "CropBox" );
+    public static final COSName CROP_BOX = new COSName("CropBox");
     /**
      * A common COSName value.
      */
-    public static final COSName CRYPT = new COSName( "Crypt" );
+    public static final COSName CRYPT = new COSName("Crypt");
     /**
      * A common COSName value.
      */
-    public static final COSName CS = new COSName(  "CS" );
+    public static final COSName CS = new COSName("CS");
     /**
      * A common COSName value.
      */
-    public static final COSName DEFAULT = new COSName( "default" );
+    public static final COSName DEFAULT = new COSName("default");
     /**
      * A common COSName value.
      */
-    public static final COSName D = new COSName( "D" );
+    public static final COSName D = new COSName("D");
     /**
      * A common COSName value.
      */
-    public static final COSName DA = new COSName( "DA" );
+    public static final COSName DA = new COSName("DA");
     /**
      * A common COSName value.
      */
-    public static final COSName DATE = new COSName( "Date" );
+    public static final COSName DATE = new COSName("Date");
     /**
      * A common COSName value.
      */
-    public static final COSName DCT_DECODE = new COSName( "DCTDecode" );
+    public static final COSName DCT_DECODE = new COSName("DCTDecode");
     /**
      * A common COSName value.
      */
-    public static final COSName DCT_DECODE_ABBREVIATION = new COSName( "DCT" );
+    public static final COSName DCT_DECODE_ABBREVIATION = new COSName("DCT");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DECODE = new COSName( "Decode" );
+    public static final COSName DECODE = new COSName("Decode");
     /**
      * A common COSName value.
      */
-    public static final COSName DECODE_PARMS = new COSName( "DecodeParms" );
+    public static final COSName DECODE_PARMS = new COSName("DecodeParms");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DESCENT = new COSName(  "Descent" );
+    public static final COSName DESCENT = new COSName("Descent");
     /**
      * A common COSName value.
      */
-    public static final COSName DESCENDANT_FONTS = new COSName(  "DescendantFonts" );
+    public static final COSName DESCENDANT_FONTS = new COSName("DescendantFonts");
     /**
      * A common COSName value.
      */
-    public static final COSName DEST = new COSName(  "Dest" );
+    public static final COSName DEST = new COSName("Dest");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DESTS = new COSName( "Dests" );
+    public static final COSName DESTS = new COSName("Dests");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DEST_OUTPUT_PROFILE = new COSName( "DestOutputProfile" ); 
-    
+    public static final COSName DEST_OUTPUT_PROFILE = new COSName("DestOutputProfile");
+
     /**
-    * A common COSName value.
-    */
-    public static final COSName DEVICECMYK = new COSName( "DeviceCMYK" );
+     * A common COSName value.
+     */
+    public static final COSName DEVICECMYK = new COSName("DeviceCMYK");
     /**
-    * A common COSName value.
-    */
-    public static final COSName DEVICEGRAY = new COSName( "DeviceGray" );
+     * A common COSName value.
+     */
+    public static final COSName DEVICEGRAY = new COSName("DeviceGray");
     /**
-    * A common COSName value.
-    */
-    public static final COSName DEVICEN = new COSName( "DeviceN" );
+     * A common COSName value.
+     */
+    public static final COSName DEVICEN = new COSName("DeviceN");
     /**
-    * A common COSName value.
-    */
-    public static final COSName DEVICERGB = new COSName( "DeviceRGB" );
+     * A common COSName value.
+     */
+    public static final COSName DEVICERGB = new COSName("DeviceRGB");
     /**
      * A common COSName value.
      */
-    public static final COSName DIFFERENCES = new COSName( "Differences" );
+    public static final COSName DIFFERENCES = new COSName("Differences");
     /**
      * A common COSName value.
      */
-    public static final COSName DIGEST_METHOD = new COSName( "DigestMethod" );
+    public static final COSName DIGEST_METHOD = new COSName("DigestMethod");
     /**
      * Digest Method.
      */
@@ -456,55 +453,55 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName DIRECTION = new COSName( "Direction" );
+    public static final COSName DIRECTION = new COSName("Direction");
     /**
      * A common COSName value.
      */
-    public static final COSName DISPLAY_DOC_TITLE = new COSName( "DisplayDocTitle" );
+    public static final COSName DISPLAY_DOC_TITLE = new COSName("DisplayDocTitle");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DL = new COSName( "DL" );
-    
+    public static final COSName DL = new COSName("DL");
+
     /**
      * A common COSName value.
      */
-    public static final COSName DOC_CHECKSUM = new COSName( "DocChecksum" );
+    public static final COSName DOC_CHECKSUM = new COSName("DocChecksum");
     /**
      * A common COSName value.
      */
-    public static final COSName DOC_TIME_STAMP = new COSName( "DocTimeStamp" );
+    public static final COSName DOC_TIME_STAMP = new COSName("DocTimeStamp");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DOMAIN = new COSName( "Domain" );
+    public static final COSName DOMAIN = new COSName("Domain");
     /**
      * A common COSName value.
      */
-    public static final COSName DOS = new COSName( "DOS" );
+    public static final COSName DOS = new COSName("DOS");
     /**
      * A common COSName value.
      */
-    public static final COSName DP = new COSName( "DP" );
+    public static final COSName DP = new COSName("DP");
 
     /**
      * A common COSName value.
      */
-    public static final COSName DR = new COSName( "DR" );
+    public static final COSName DR = new COSName("DR");
     /**
      * A common COSName value.
      */
-    public static final COSName DUPLEX = new COSName( "Duplex" );
+    public static final COSName DUPLEX = new COSName("Duplex");
     /**
      * A common COSName value.
      */
-    public static final COSName DV = new COSName( "DV" );
+    public static final COSName DV = new COSName("DV");
     /**
      * A common COSName value.
      */
-    public static final COSName DW = new COSName( "DW" );
+    public static final COSName DW = new COSName("DW");
 
     /**
      * A common COSName value.
@@ -518,130 +515,130 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName EMBEDDED_FILES = new COSName( "EmbeddedFiles" );
+    public static final COSName EMBEDDED_FILES = new COSName("EmbeddedFiles");
 
     /**
      * A common COSName value.
      */
-    public static final COSName EMBEDDED_FDFS = new COSName( "EmbeddedFDFs" );
-    
+    public static final COSName EMBEDDED_FDFS = new COSName("EmbeddedFDFs");
+
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODE = new COSName( "Encode" );
+    public static final COSName ENCODE = new COSName("Encode");
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODING = new COSName( "Encoding" );
+    public static final COSName ENCODING = new COSName("Encoding");
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODING_90MS_RKSJ_H = new COSName( "90ms-RKSJ-H" );
+    public static final COSName ENCODING_90MS_RKSJ_H = new COSName("90ms-RKSJ-H");
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODING_90MS_RKSJ_V = new COSName( "90ms-RKSJ-V" );
+    public static final COSName ENCODING_90MS_RKSJ_V = new COSName("90ms-RKSJ-V");
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODING_ETEN_B5_H = new COSName( "ETen?B5?H" );
+    public static final COSName ENCODING_ETEN_B5_H = new COSName("ETen?B5?H");
     /**
      * A common COSName value.
      */
-    public static final COSName ENCODING_ETEN_B5_V = new COSName( "ETen?B5?V" );
+    public static final COSName ENCODING_ETEN_B5_V = new COSName("ETen?B5?V");
 
     /**
      * A common COSName value.
      */
-    public static final COSName ENCRYPT = new COSName( "Encrypt" );
+    public static final COSName ENCRYPT = new COSName("Encrypt");
 
     /**
      * A common COSName value.
      */
-    public static final COSName ENCRYPT_META_DATA = new COSName( "EncryptMetadata" );
-    
+    public static final COSName ENCRYPT_META_DATA = new COSName("EncryptMetadata");
+
     /**
      * A common COSName value.
      */
-    public static final COSName EXT_G_STATE = new COSName( "ExtGState" );
+    public static final COSName EXT_G_STATE = new COSName("ExtGState");
 
     /**
      * A common COSName value.
      */
-    public static final COSName EXTEND = new COSName( "Extend" );
+    public static final COSName EXTEND = new COSName("Extend");
 
     /**
      * A common COSName value.
      */
-    public static final COSName EXTENDS = new COSName( "Extends" );
+    public static final COSName EXTENDS = new COSName("Extends");
 
     /**
      * A common COSName value.
      */
-    public static final COSName F = new COSName( "F" );
+    public static final COSName F = new COSName("F");
 
     /**
      * A common COSName value.
      */
-    public static final COSName F_DECODE_PARMS = new COSName( "FDecodeParms" );
+    public static final COSName F_DECODE_PARMS = new COSName("FDecodeParms");
 
     /**
      * A common COSName value.
      */
-    public static final COSName F_FILTER = new COSName( "FFilter" );
+    public static final COSName F_FILTER = new COSName("FFilter");
 
     /**
      * A common COSName value.
      */
-    public static final COSName FF = new COSName( "Ff" );
+    public static final COSName FF = new COSName("Ff");
     /**
      * A common COSName value.
      */
-    public static final COSName FIELDS = new COSName( "Fields" );
+    public static final COSName FIELDS = new COSName("Fields");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FILESPEC = new COSName( "Filespec" );
+     * A common COSName value.
+     */
+    public static final COSName FILESPEC = new COSName("Filespec");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FILTER = new COSName( "Filter" );
+     * A common COSName value.
+     */
+    public static final COSName FILTER = new COSName("Filter");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FIRST = new COSName( "First" );
+     * A common COSName value.
+     */
+    public static final COSName FIRST = new COSName("First");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FIRST_CHAR = new COSName( "FirstChar" );
+     * A common COSName value.
+     */
+    public static final COSName FIRST_CHAR = new COSName("FirstChar");
     /**
      * A common COSName value.
      */
-    public static final COSName FIT_WINDOW = new COSName( "FitWindow" );
+    public static final COSName FIT_WINDOW = new COSName("FitWindow");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FL = new COSName( "FL" );
+     * A common COSName value.
+     */
+    public static final COSName FL = new COSName("FL");
     /**
      * A common COSName value.
      */
-    public static final COSName FLAGS = new COSName( "Flags" );
+    public static final COSName FLAGS = new COSName("Flags");
     /**
      * A common COSName value.
      */
-    public static final COSName FLATE_DECODE = new COSName( "FlateDecode" );
+    public static final COSName FLATE_DECODE = new COSName("FlateDecode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FLATE_DECODE_ABBREVIATION = new COSName( "Fl" );
+     * A common COSName value.
+     */
+    public static final COSName FLATE_DECODE_ABBREVIATION = new COSName("Fl");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FONT = new COSName( "Font" );
+     * A common COSName value.
+     */
+    public static final COSName FONT = new COSName("Font");
     /**
      * A common COSName value.
      */
-    public static final COSName FONT_BBOX = new COSName( "FontBBox" );
+    public static final COSName FONT_BBOX = new COSName("FontBBox");
     /**
      * A common COSName value.
      */
@@ -665,78 +662,78 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName FONT_MATRIX = new COSName("FontMatrix" );
+    public static final COSName FONT_MATRIX = new COSName("FontMatrix");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FONT_NAME = new COSName("FontName" );
+     * A common COSName value.
+     */
+    public static final COSName FONT_NAME = new COSName("FontName");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FONT_STRETCH = new COSName("FontStretch" );
+     * A common COSName value.
+     */
+    public static final COSName FONT_STRETCH = new COSName("FontStretch");
     /**
      * A common COSName value.
      */
-    public static final COSName FONT_WEIGHT = new COSName("FontWeight" );
+    public static final COSName FONT_WEIGHT = new COSName("FontWeight");
     /**
-    * A common COSName value.
-    */
-    public static final COSName FORM = new COSName( "Form" );
+     * A common COSName value.
+     */
+    public static final COSName FORM = new COSName("Form");
     /**
      * A common COSName value.
      */
-    public static final COSName FORMTYPE = new COSName( "FormType" );
+    public static final COSName FORMTYPE = new COSName("FormType");
     /**
      * A common COSName value.
      */
-    public static final COSName FRM = new COSName( "FRM" );
+    public static final COSName FRM = new COSName("FRM");
     /**
      * A common COSName value.
      */
-    public static final COSName FT = new COSName( "FT" );
+    public static final COSName FT = new COSName("FT");
     /**
      * A common COSName value.
      */
-    public static final COSName FUNCTION = new COSName( "Function" );
+    public static final COSName FUNCTION = new COSName("Function");
     /**
      * A common COSName value.
      */
-    public static final COSName FUNCTION_TYPE = new COSName( "FunctionType" );
+    public static final COSName FUNCTION_TYPE = new COSName("FunctionType");
     /**
      * A common COSName value.
      */
-    public static final COSName FUNCTIONS = new COSName( "Functions" );
+    public static final COSName FUNCTIONS = new COSName("Functions");
     /**
      * A common COSName value.
      */
-    public static final COSName GAMMA = new COSName( "Gamma" );
+    public static final COSName GAMMA = new COSName("Gamma");
 
     /**
      * A common COSName value.
      */
-    public static final COSName GTS_PDFA1 = new COSName ("GTS_PDFA1");
-    
-    public static final COSName H = new COSName( "H" );
+    public static final COSName GTS_PDFA1 = new COSName("GTS_PDFA1");
+
+    public static final COSName H = new COSName("H");
     /**
-    * A common COSName value.
-    */
-    public static final COSName HEIGHT = new COSName( "Height" );
+     * A common COSName value.
+     */
+    public static final COSName HEIGHT = new COSName("Height");
     /**
      * A common COSName value.
      */
-    public static final COSName HIDE_MENUBAR = new COSName( "HideMenubar" );
+    public static final COSName HIDE_MENUBAR = new COSName("HideMenubar");
     /**
      * A common COSName value.
      */
-    public static final COSName HIDE_TOOLBAR = new COSName( "HideToolbar" );
+    public static final COSName HIDE_TOOLBAR = new COSName("HideToolbar");
     /**
      * A common COSName value.
      */
-    public static final COSName HIDE_WINDOWUI = new COSName( "HideWindowUI" );
+    public static final COSName HIDE_WINDOWUI = new COSName("HideWindowUI");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ICCBASED = new COSName( "ICCBased" );
+     * A common COSName value.
+     */
+    public static final COSName ICCBASED = new COSName("ICCBased");
 
     /**
      * A common COSName value.
@@ -756,55 +753,55 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName IDENTITY = new COSName( "Identity" );
+    public static final COSName IDENTITY = new COSName("Identity");
     /**
-    * A common COSName value.
-    */
-    public static final COSName IDENTITY_H = new COSName( "Identity-H" );
+     * A common COSName value.
+     */
+    public static final COSName IDENTITY_H = new COSName("Identity-H");
     /**
-    * A common COSName value.
-    */
-    public static final COSName IMAGE = new COSName( "Image" );
+     * A common COSName value.
+     */
+    public static final COSName IMAGE = new COSName("Image");
     /**
      * A common COSName value.
      */
-    public static final COSName IMAGE_MASK = new COSName( "ImageMask" );
+    public static final COSName IMAGE_MASK = new COSName("ImageMask");
 
     /**
      * A common COSName value.
      */
-    public static final COSName INDEX = new COSName( "Index" );
+    public static final COSName INDEX = new COSName("Index");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName INDEXED = new COSName( "Indexed" );
+     * A common COSName value.
+     */
+    public static final COSName INDEXED = new COSName("Indexed");
     /**
      * A common COSName value.
      */
-    public static final COSName INFO = new COSName( "Info" );
+    public static final COSName INFO = new COSName("Info");
     /**
      * A common COSName value.
      */
-    public static final COSName ITALIC_ANGLE = new COSName( "ItalicAngle" );
+    public static final COSName ITALIC_ANGLE = new COSName("ItalicAngle");
 
     /**
      * A common COSName value.
      */
-    public static final COSName JAVA_SCRIPT = new COSName( "JavaScript" );
+    public static final COSName JAVA_SCRIPT = new COSName("JavaScript");
 
     /**
      * A common COSName value.
      */
-    public static final COSName JBIG2_DECODE = new COSName( "JBIG2Decode" );
+    public static final COSName JBIG2_DECODE = new COSName("JBIG2Decode");
     /**
      * A common COSName value.
      */
-    public static final COSName JBIG2_GLOBALS = new COSName( "JBIG2Globals" );
+    public static final COSName JBIG2_GLOBALS = new COSName("JBIG2Globals");
     /**
-    * A common COSName value.
-    */
-    public static final COSName JPX_DECODE = new COSName( "JPXDecode" );
+     * A common COSName value.
+     */
+    public static final COSName JPX_DECODE = new COSName("JPXDecode");
 
     /**
      * A common COSName value.
@@ -814,17 +811,17 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName KEYWORDS = new COSName( "Keywords" );
+    public static final COSName KEYWORDS = new COSName("Keywords");
 
     /**
      * A common COSName value.
      */
-    public static final COSName KIDS = new COSName( "Kids" );
+    public static final COSName KIDS = new COSName("Kids");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName LAB = new COSName( "Lab" );
+     * A common COSName value.
+     */
+    public static final COSName LAB = new COSName("Lab");
 
     /**
      * A common COSName value.
@@ -834,69 +831,69 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName LAST_CHAR = new COSName( "LastChar" );
+    public static final COSName LAST_CHAR = new COSName("LastChar");
     /**
      * A common COSName value.
      */
-    public static final COSName LAST_MODIFIED = new COSName( "LastModified" );
+    public static final COSName LAST_MODIFIED = new COSName("LastModified");
     /**
      * A common COSName value.
      */
-    public static final COSName LC = new COSName( "LC" );
+    public static final COSName LC = new COSName("LC");
     /**
      * A common COSName value.
      */
-    public static final COSName L = new COSName( "L" );
+    public static final COSName L = new COSName("L");
     /**
      * A common COSName value.
      */
-    public static final COSName LEADING = new COSName( "Leading" );
+    public static final COSName LEADING = new COSName("Leading");
     /**
-    * A common COSName value.
-    */
-    public static final COSName LEGAL_ATTESTATION = new COSName( "LegalAttestation" );
+     * A common COSName value.
+     */
+    public static final COSName LEGAL_ATTESTATION = new COSName("LegalAttestation");
     /**
-    * A common COSName value.
-    */
-    public static final COSName LENGTH = new COSName( "Length" );
+     * A common COSName value.
+     */
+    public static final COSName LENGTH = new COSName("Length");
     /**
      * A common COSName value.
      */
-    public static final COSName LENGTH1 = new COSName( "Length1" );
+    public static final COSName LENGTH1 = new COSName("Length1");
 
-    public static final COSName LENGTH2 = new COSName( "Length2" );
+    public static final COSName LENGTH2 = new COSName("Length2");
     /**
      * A common COSName value.
      */
-    public static final COSName LIMITS = new COSName( "Limits" );
+    public static final COSName LIMITS = new COSName("Limits");
     /**
      * A common COSName value.
      */
-    public static final COSName LJ = new COSName( "LJ" );
+    public static final COSName LJ = new COSName("LJ");
     /**
-    * A common COSName value.
-    */
-    public static final COSName LW = new COSName( "LW" );
+     * A common COSName value.
+     */
+    public static final COSName LW = new COSName("LW");
     /**
      * A common COSName value.
      */
-    public static final COSName LZW_DECODE = new COSName( "LZWDecode" );
+    public static final COSName LZW_DECODE = new COSName("LZWDecode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName LZW_DECODE_ABBREVIATION = new COSName( "LZW" );
+     * A common COSName value.
+     */
+    public static final COSName LZW_DECODE_ABBREVIATION = new COSName("LZW");
     /**
      * A common COSName value.
      */
-    public static final COSName M = new COSName( "M" );
+    public static final COSName M = new COSName("M");
     /**
-    * A common COSName value.
-    */
-    public static final COSName MAC = new COSName( "Mac" );
+     * A common COSName value.
+     */
+    public static final COSName MAC = new COSName("Mac");
     /**
-    * A common COSName value.
-    */
-    public static final COSName MAC_ROMAN_ENCODING = new COSName( "MacRomanEncoding" );
+     * A common COSName value.
+     */
+    public static final COSName MAC_ROMAN_ENCODING = new COSName("MacRomanEncoding");
 
     /**
      * A common COSName value.
@@ -906,15 +903,15 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName MASK = new COSName( "Mask" );
+    public static final COSName MASK = new COSName("Mask");
     /**
      * A common COSName value.
      */
-    public static final COSName MATRIX = new COSName( "Matrix" );
+    public static final COSName MATRIX = new COSName("Matrix");
     /**
      * A common COSName value.
      */
-    public static final COSName MAX_WIDTH = new COSName( "MaxWidth" );
+    public static final COSName MAX_WIDTH = new COSName("MaxWidth");
     /**
      * A common COSName value.
      */
@@ -926,61 +923,69 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName MEDIA_BOX = new COSName(  "MediaBox" );
+    public static final COSName MEDIA_BOX = new COSName("MediaBox");
     /**
      * A common COSName value.
      */
-    public static final COSName METADATA = new COSName(  "Metadata" );
+    public static final COSName STRUCT_PARENT = new COSName("StructParent");
     /**
      * A common COSName value.
      */
-    public static final COSName MISSING_WIDTH = new COSName( "MissingWidth" );
+    public static final COSName STRUCT_PARENTS = new COSName("StructParents");
     /**
      * A common COSName value.
      */
-    public static final COSName ML = new COSName( "ML" );
+    public static final COSName METADATA = new COSName("Metadata");
     /**
-    * A common COSName value.
-    */
-    public static final COSName MM_TYPE1 = new COSName(  "MMType1" );
+     * A common COSName value.
+     */
+    public static final COSName MISSING_WIDTH = new COSName("MissingWidth");
     /**
      * A common COSName value.
      */
-    public static final COSName MOD_DATE = new COSName(  "ModDate" );
+    public static final COSName ML = new COSName("ML");
     /**
-    * A common COSName value.
-    */
-    public static final COSName N = new COSName( "N" );
+     * A common COSName value.
+     */
+    public static final COSName MM_TYPE1 = new COSName("MMType1");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName MOD_DATE = new COSName("ModDate");
     /**
-    * A common COSName value.
-    */
-    public static final COSName NAME = new COSName( "Name" );
+     * A common COSName value.
+     */
+    public static final COSName N = new COSName("N");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName NAME = new COSName("Name");
 
     /**
      * A common COSName value.
      */
-    public static final COSName NAMES = new COSName( "Names" );
+    public static final COSName NAMES = new COSName("Names");
 
     /**
      * A common COSName value.
      */
-    public static final COSName NEXT = new COSName( "Next" );
+    public static final COSName NEXT = new COSName("Next");
     /**
      * A common COSName value.
      */
-    public static final COSName NM = new COSName( "NM" );
+    public static final COSName NM = new COSName("NM");
     /**
      * A common COSName value.
      */
-    public static final COSName NON_EFONT_NO_WARN = new COSName( "NonEFontNoWarn" );
+    public static final COSName NON_EFONT_NO_WARN = new COSName("NonEFontNoWarn");
     /**
      * A common COSName value.
      */
-    public static final COSName NON_FULL_SCREEN_PAGE_MODE = new COSName( "NonFullScreenPageMode" );
+    public static final COSName NON_FULL_SCREEN_PAGE_MODE = new COSName("NonFullScreenPageMode");
     /**
      * A common COSName value.
      */
-    public static final COSName NUMS = new COSName( "Nums" );
+    public static final COSName NUMS = new COSName("Nums");
 
     /**
      * A common COSName value.
@@ -994,7 +999,7 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName OBJ_STM = new COSName( "ObjStm" );
+    public static final COSName OBJ_STM = new COSName("ObjStm");
 
     /** the COSName for the content group tag. */
     public static final COSName OC = new COSName("OC");
@@ -1013,23 +1018,23 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName OP = new COSName( "OP" );
+    public static final COSName OP = new COSName("OP");
     /**
      * A common COSName value.
      */
-    public static final COSName OP_NS = new COSName( "op" );
+    public static final COSName OP_NS = new COSName("op");
     /**
      * A common COSName value.
      */
-    public static final COSName OPM = new COSName( "OPM" );
+    public static final COSName OPM = new COSName("OPM");
     /**
      * A common COSName value.
      */
-    public static final COSName OPT = new COSName( "Opt" );
+    public static final COSName OPT = new COSName("Opt");
     /**
      * A common COSName value.
      */
-    public static final COSName OS = new COSName( "OS" );
+    public static final COSName OS = new COSName("OS");
 
     /**
      * A common COSName value.
@@ -1039,22 +1044,22 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName OUTPUT_INTENT = new COSName( "OutputIntent" ); 
+    public static final COSName OUTPUT_INTENT = new COSName("OutputIntent");
 
     /**
      * A common COSName value.
      */
-    public static final COSName OUTPUT_INTENTS = new COSName( "OutputIntents" ); 
+    public static final COSName OUTPUT_INTENTS = new COSName("OutputIntents");
 
     /**
      * A common COSName value.
      */
-    public static final COSName OUTPUT_CONDITION = new COSName("OutputCondition"); 
-    
+    public static final COSName OUTPUT_CONDITION = new COSName("OutputCondition");
+
     /**
      * A common COSName value.
      */
-    public static final COSName OUTPUT_CONDITION_IDENTIFIER = new COSName("OutputConditionIdentifier"); 
+    public static final COSName OUTPUT_CONDITION_IDENTIFIER = new COSName("OutputConditionIdentifier");
 
     /**
      * A common COSName value.
@@ -1062,20 +1067,20 @@ public final class COSName extends COSBa
     public static final COSName OPEN_ACTION = new COSName("OpenAction");
 
     /** A common COSName value. */
-     public static final COSName ORDER = new COSName( "Order" );
+    public static final COSName ORDER = new COSName("Order");
 
     /**
      * A common COSName value.
      */
-     public static final COSName ORDERING = new COSName( "Ordering" );
+    public static final COSName ORDERING = new COSName("Ordering");
     /**
      * A common COSName value.
      */
-    public static final COSName P = new COSName( "P" );
+    public static final COSName P = new COSName("P");
     /**
      * A common COSName value.
      */
-    public static final COSName PAGE = new COSName( "Page" );
+    public static final COSName PAGE = new COSName("Page");
 
     /**
      * A common COSName value.
@@ -1093,33 +1098,37 @@ public final class COSName extends COSBa
     public static final COSName PAGE_MODE = new COSName("PageMode");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName PAGES = new COSName( "Pages" );
-    /**
-    * A common COSName value.
-    */
-    public static final COSName PAINT_TYPE = new COSName( "PaintType" );
-    /**
-    * A common COSName value.
-    */
-    public static final COSName PARENT = new COSName( "Parent" );
+     * A common COSName value.
+     */
+    public static final COSName PAGES = new COSName("Pages");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName PAINT_TYPE = new COSName("PaintType");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName PARENT = new COSName("Parent");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName PARENT_TREE = new COSName("ParentTree");
     /**
      * A common COSName value.
      */
     public static final COSName PARENT_TREE_NEXT_KEY = new COSName("ParentTreeNextKey");
     /**
-    * A common COSName value.
-    */
-    public static final COSName PATTERN = new COSName( "Pattern" );
-    /**
-    * A common COSName value.
-    */
-    public static final COSName PATTERN_TYPE = new COSName( "PatternType" );
-    /**
-    * A common COSName value.
-    */
-    public static final COSName PDF_DOC_ENCODING = new COSName( "PDFDocEncoding" );
+     * A common COSName value.
+     */
+    public static final COSName PATTERN = new COSName("Pattern");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName PATTERN_TYPE = new COSName("PatternType");
+    /**
+     * A common COSName value.
+     */
+    public static final COSName PDF_DOC_ENCODING = new COSName("PDFDocEncoding");
     /**
      * A common COSName value.
      */
@@ -1127,76 +1136,76 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName PRE_RELEASE = new COSName( "PreRelease" );
+    public static final COSName PRE_RELEASE = new COSName("PreRelease");
     /**
      * A common COSName value.
      */
-    public static final COSName PREDICTOR = new COSName( "Predictor" );
+    public static final COSName PREDICTOR = new COSName("Predictor");
     /**
      * A common COSName value.
      */
-    public static final COSName PREV = new COSName( "Prev" );
+    public static final COSName PREV = new COSName("Prev");
 
     /**
      * A common COSName value.
      */
-    public static final COSName PRINT_AREA = new COSName( "PrintArea" );
+    public static final COSName PRINT_AREA = new COSName("PrintArea");
     /**
      * A common COSName value.
      */
-    public static final COSName PRINT_CLIP = new COSName( "PrintClip" );
+    public static final COSName PRINT_CLIP = new COSName("PrintClip");
     /**
      * A common COSName value.
      */
-    public static final COSName PRINT_SCALING = new COSName( "PrintScaling" );
-    
+    public static final COSName PRINT_SCALING = new COSName("PrintScaling");
+
     /** The COSName value for "ProcSet". */
-    public static final COSName PROC_SET = new COSName( "ProcSet" );
+    public static final COSName PROC_SET = new COSName("ProcSet");
 
     /**
      * A common COSName value.
      */
-    public static final COSName PRODUCER = new COSName( "Producer" );
+    public static final COSName PRODUCER = new COSName("Producer");
 
     /**
      * A common COSName value.
      */
-    public static final COSName PROP_BUILD = new COSName( "Prop_Build" );
+    public static final COSName PROP_BUILD = new COSName("Prop_Build");
     /** The COSName value for "Properties". */
-    public static final COSName PROPERTIES = new COSName( "Properties" );
+    public static final COSName PROPERTIES = new COSName("Properties");
 
     /**
      * A common COSName value.
      */
-    public static final COSName PUB_SEC = new COSName( "PubSec" );
+    public static final COSName PUB_SEC = new COSName("PubSec");
     /**
      * A common COSName value.
      */
-    public static final COSName Q = new COSName( "Q" );
+    public static final COSName Q = new COSName("Q");
     /**
      * A common COSName value.
      */
-    public static final COSName R = new COSName( "R" );
+    public static final COSName R = new COSName("R");
     /**
      * A common COSName value.
      */
-    public static final COSName RANGE = new COSName( "Range" );
+    public static final COSName RANGE = new COSName("Range");
     /**
      * A common COSName value.
      */
-    public static final COSName REASONS = new COSName( "Reasons" );
+    public static final COSName REASONS = new COSName("Reasons");
     /**
      * A common COSName value.
      */
-    public static final COSName RECIPIENTS = new COSName( "Recipients" );
+    public static final COSName RECIPIENTS = new COSName("Recipients");
     /**
      * A common COSName value.
      */
-    public static final COSName RECT = new COSName( "Rect" );
+    public static final COSName RECT = new COSName("Rect");
     /**
      * A common COSName value.
      */
-    public static final COSName REGISTRY = new COSName( "Registry" );
+    public static final COSName REGISTRY = new COSName("Registry");
 
     /**
      * A common COSName value.
@@ -1204,41 +1213,41 @@ public final class COSName extends COSBa
     public static final COSName REGISTRY_NAME = new COSName("RegistryName");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName RESOURCES = new COSName( "Resources" );
+     * A common COSName value.
+     */
+    public static final COSName RESOURCES = new COSName("Resources");
     /**
      * A common COSName value.
      */
-    public static final COSName RI = new COSName( "RI" );
+    public static final COSName RI = new COSName("RI");
     /**
      * A common COSName value.
      */
     public static final COSName ROLE_MAP = new COSName("RoleMap");
     /**
-    * A common COSName value.
-    */
-    public static final COSName ROOT = new COSName( "Root" );
+     * A common COSName value.
+     */
+    public static final COSName ROOT = new COSName("Root");
     /**
      * A common COSName value.
      */
-    public static final COSName ROTATE = new COSName(  "Rotate" );
+    public static final COSName ROTATE = new COSName("Rotate");
     /**
      * A common COSName value.
      */
-    public static final COSName ROWS = new COSName(  "Rows" );
+    public static final COSName ROWS = new COSName("Rows");
     /**
-    * A common COSName value.
-    */
-    public static final COSName RUN_LENGTH_DECODE = new COSName( "RunLengthDecode" );
+     * A common COSName value.
+     */
+    public static final COSName RUN_LENGTH_DECODE = new COSName("RunLengthDecode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName RUN_LENGTH_DECODE_ABBREVIATION = new COSName( "RL" );
+     * A common COSName value.
+     */
+    public static final COSName RUN_LENGTH_DECODE_ABBREVIATION = new COSName("RL");
     /**
      * A common COSName value.
      */
-    public static final COSName RV = new COSName( "RV" );
+    public static final COSName RV = new COSName("RV");
     /**
      * A common COSName value.
      */
@@ -1246,73 +1255,73 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName SA = new COSName( "SA" );
+    public static final COSName SA = new COSName("SA");
     /**
      * A common COSName value.
      */
-    public static final COSName SE = new COSName( "SE" );
+    public static final COSName SE = new COSName("SE");
     /**
      * A common COSName value.
      */
-    public static final COSName SEPARATION = new COSName( "Separation" );
+    public static final COSName SEPARATION = new COSName("Separation");
     /**
      * A common COSName value.
      */
-    public static final COSName SET_F = new COSName( "SetF" );
+    public static final COSName SET_F = new COSName("SetF");
     /**
      * A common COSName value.
      */
-    public static final COSName SET_FF = new COSName( "SetFf" );
+    public static final COSName SET_FF = new COSName("SetFf");
 
     /**
      * A common COSName value.
      */
-    public static final COSName SHADING = new COSName( "Shading" );
+    public static final COSName SHADING = new COSName("Shading");
     /**
      * A common COSName value.
      */
-    public static final COSName SHADING_TYPE = new COSName( "ShadingType" );
+    public static final COSName SHADING_TYPE = new COSName("ShadingType");
     /**
      * A common COSName value.
      */
-    public static final COSName SM = new COSName( "SM" );
+    public static final COSName SM = new COSName("SM");
     /**
      * A common COSName value.
      */
-    public static final COSName SMASK = new COSName( "SMask" );
+    public static final COSName SMASK = new COSName("SMask");
     /**
      * A common COSName value.
      */
-    public static final COSName SIZE = new COSName( "Size" );
+    public static final COSName SIZE = new COSName("Size");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName STANDARD_ENCODING = new COSName( "StandardEncoding" );
+     * A common COSName value.
+     */
+    public static final COSName STANDARD_ENCODING = new COSName("StandardEncoding");
     /**
      * A common COSName value.
      */
-    public static final COSName STATUS = new COSName( "Status" );
+    public static final COSName STATUS = new COSName("Status");
     /**
      * A common COSName value.
      */
-    public static final COSName STD_CF = new COSName( "StdCF" );
+    public static final COSName STD_CF = new COSName("StdCF");
     /**
      * A common COSName value.
      */
-    public static final COSName STEM_H = new COSName( "StemH" );
+    public static final COSName STEM_H = new COSName("StemH");
     /**
      * A common COSName value.
      */
-    public static final COSName STEM_V = new COSName( "StemV" );
+    public static final COSName STEM_V = new COSName("StemV");
     /**
      * A common COSName value.
      */
-    public static final COSName STM_F = new COSName( "StmF" );
+    public static final COSName STM_F = new COSName("StmF");
     /**
      * A common COSName value.
      */
-    public static final COSName STR_F = new COSName( "StrF" );
+    public static final COSName STR_F = new COSName("StrF");
 
     /**
      * A common COSName value.
@@ -1322,27 +1331,27 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName SUB_FILTER = new COSName( "SubFilter" );
+    public static final COSName SUB_FILTER = new COSName("SubFilter");
     /**
-    * A common COSName value.
-    */
-    public static final COSName SUBJ = new COSName( "Subj" );
+     * A common COSName value.
+     */
+    public static final COSName SUBJ = new COSName("Subj");
     /**
      * A common COSName value.
      */
-    public static final COSName SUBJECT = new COSName( "Subject" );
+    public static final COSName SUBJECT = new COSName("Subject");
     /**
      * A common COSName value.
      */
-    public static final COSName SUPPLEMENT = new COSName( "Supplement" );
+    public static final COSName SUPPLEMENT = new COSName("Supplement");
     /**
      * A common COSName value.
      */
-    public static final COSName SUBTYPE = new COSName( "Subtype" );
+    public static final COSName SUBTYPE = new COSName("Subtype");
     /**
      * A common COSName value.
      */
-    public static final COSName SV = new COSName( "SV" );
+    public static final COSName SV = new COSName("SV");
 
     /**
      * A common COSName value.
@@ -1362,74 +1371,74 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName TILING_TYPE = new COSName( "TilingType" );
+    public static final COSName TILING_TYPE = new COSName("TilingType");
     /**
      * A common COSName value.
      */
-    public static final COSName TIME_STAMP = new COSName( "TimeStamp" );
+    public static final COSName TIME_STAMP = new COSName("TimeStamp");
     /**
      * A common COSName value.
      */
-    public static final COSName TITLE = new COSName( "Title" );
+    public static final COSName TITLE = new COSName("Title");
     /**
      * A common COSName value.
      */
-    public static final COSName TK = new COSName( "TK" );
+    public static final COSName TK = new COSName("TK");
     /**
      * A common COSName value.
      */
-    public static final COSName TRAPPED = new COSName("Trapped" );
+    public static final COSName TRAPPED = new COSName("Trapped");
     /**
      * A common COSName value.
      */
-    public static final COSName TRIM_BOX = new COSName("TrimBox" );
+    public static final COSName TRIM_BOX = new COSName("TrimBox");
     /**
      * A common COSName value.
      */
-    public static final COSName TRUE_TYPE = new COSName("TrueType" );
+    public static final COSName TRUE_TYPE = new COSName("TrueType");
     /**
      * A common COSName value.
      */
-    public static final COSName TRUSTED_MODE = new COSName("TrustedMode" );
+    public static final COSName TRUSTED_MODE = new COSName("TrustedMode");
     /**
-    * A common COSName value.
-    */
-    public static final COSName TO_UNICODE = new COSName( "ToUnicode" );
+     * A common COSName value.
+     */
+    public static final COSName TO_UNICODE = new COSName("ToUnicode");
     /**
      * A common COSName value.
      */
-    public static final COSName TU = new COSName("TU" );
+    public static final COSName TU = new COSName("TU");
     /**
-    * A common COSName value.
-    */
-    public static final COSName TYPE = new COSName( "Type" );
+     * A common COSName value.
+     */
+    public static final COSName TYPE = new COSName("Type");
     /**
      * A common COSName value.
      */
-    public static final COSName TYPE0 = new COSName(  "Type0" );
+    public static final COSName TYPE0 = new COSName("Type0");
     /**
-    * A common COSName value.
-    */
-    public static final COSName TYPE1 = new COSName(  "Type1" );
+     * A common COSName value.
+     */
+    public static final COSName TYPE1 = new COSName("Type1");
     /**
-    * A common COSName value.
-    */
-    public static final COSName TYPE3 = new COSName(  "Type3" );
+     * A common COSName value.
+     */
+    public static final COSName TYPE3 = new COSName("Type3");
 
     /**
      * A common COSName value.
      */
-    public static final COSName U = new COSName( "U" );
+    public static final COSName U = new COSName("U");
     /**
      * A common COSName value.
      */
-    public static final COSName UF = new COSName( "UF" );
+    public static final COSName UF = new COSName("UF");
     /** the COSName for the "Unchanged" value. */
     public static final COSName UNCHANGED = new COSName("Unchanged");
     /**
      * A common COSName value.
      */
-    public static final COSName UNIX = new COSName( "Unix" );
+    public static final COSName UNIX = new COSName("Unix");
     /**
      * A common COSName value.
      */
@@ -1440,17 +1449,17 @@ public final class COSName extends COSBa
     public static final COSName URL = new COSName("URL");
 
     /**
-    * A common COSName value.
-    */
-    public static final COSName V = new COSName( "V" );
+     * A common COSName value.
+     */
+    public static final COSName V = new COSName("V");
     /**
      * A common COSName value.
      */
-    public static final COSName VERSION = new COSName( "Version" );
+    public static final COSName VERSION = new COSName("Version");
     /**
      * A common COSName value.
      */
-    public static final COSName VERTICES_PER_ROW = new COSName( "VerticesPerRow" );
+    public static final COSName VERTICES_PER_ROW = new COSName("VerticesPerRow");
 
     /**
      * A common COSName value.
@@ -1468,58 +1477,58 @@ public final class COSName extends COSBa
     /**
      * A common COSName value.
      */
-    public static final COSName W = new COSName( "W" );
+    public static final COSName W = new COSName("W");
     /**
      * A common COSName value.
      */
-    public static final COSName WIDTH = new COSName( "Width" );
+    public static final COSName WIDTH = new COSName("Width");
     /**
      * A common COSName value.
      */
-    public static final COSName WIDTHS = new COSName( "Widths" );
+    public static final COSName WIDTHS = new COSName("Widths");
     /**
-    * A common COSName value.
-    */
-    public static final COSName WIN_ANSI_ENCODING = new COSName( "WinAnsiEncoding" );
+     * A common COSName value.
+     */
+    public static final COSName WIN_ANSI_ENCODING = new COSName("WinAnsiEncoding");
     /**
      * A common COSName value.
      */
-    public static final COSName WHITE_POINT = new COSName( "WhitePoint" );
+    public static final COSName WHITE_POINT = new COSName("WhitePoint");
 
     /**
      * A common COSName value.
      */
-    public static final COSName XHEIGHT = new COSName( "XHeight" );
+    public static final COSName XHEIGHT = new COSName("XHeight");
 
     /**
      * A common COSName value.
      */
-    public static final COSName XOBJECT = new COSName( "XObject" );
+    public static final COSName XOBJECT = new COSName("XObject");
     /**
      * A common COSName value.
      */
-    public static final COSName XREF = new COSName( "XRef" );
+    public static final COSName XREF = new COSName("XRef");
 
     /**
      * A common COSName value.
      */
-    public static final COSName XREF_STM = new COSName( "XRefStm" );
+    public static final COSName XREF_STM = new COSName("XRefStm");
     /**
      * A common COSName value.
      */
-    public static final COSName X_STEP = new COSName( "XStep" );
+    public static final COSName X_STEP = new COSName("XStep");
     /**
      * A common COSName value.
      */
-    public static final COSName Y_STEP = new COSName( "YStep" );
+    public static final COSName Y_STEP = new COSName("YStep");
     /**
      * The prefix to a PDF name.
      */
-    public static final byte[] NAME_PREFIX = new byte[] { 47  }; // The / character
+    public static final byte[] NAME_PREFIX = new byte[] { 47 }; // The / character
     /**
      * The escape character for a name.
      */
-    public static final byte[] NAME_ESCAPE = new byte[] { 35  };  //The # character
+    public static final byte[] NAME_ESCAPE = new byte[] { 35 }; // The # character
 
     /**
      * A common COSName value.
@@ -1574,32 +1583,31 @@ public final class COSName extends COSBa
      */
     public static final COSName SIG_FLAGS = new COSName("SigFlags");
 
-    
     private String name;
     private int hashCode;
 
     /**
      * This will get a COSName object with that name.
-     *
+     * 
      * @param aName The name of the object.
-     *
+     * 
      * @return A COSName with the specified name.
      */
-    public static final COSName getPDFName( String aName )
+    public static final COSName getPDFName(String aName)
     {
         COSName name = null;
-        if( aName != null )
+        if (aName != null)
         {
             // Is it a common COSName ??
-            name = commonNameMap.get( aName );
-            if( name == null )
+            name = commonNameMap.get(aName);
+            if (name == null)
             {
                 // It seems to be a document specific COSName
-                name = nameMap.get( aName );
-                if( name == null )
+                name = nameMap.get(aName);
+                if (name == null)
                 {
-                    //name is added to the synchronized map in the constructor
-                    name = new COSName( aName, false );
+                    // name is added to the synchronized map in the constructor
+                    name = new COSName(aName, false);
                 }
             }
         }
@@ -1607,41 +1615,39 @@ public final class COSName extends COSBa
     }
 
     /**
-     * Private constructor.  This will limit the number of COSName objects.
-     * that are created.
-     *
+     * Private constructor. This will limit the number of COSName objects. that are created.
+     * 
      * @param aName The name of the COSName object.
-     * @param staticValue Indicates if the COSName object is static so that it can
-     *        be stored in the HashMap without synchronizing.
+     * @param staticValue Indicates if the COSName object is static so that it can be stored in the HashMap without
+     * synchronizing.
      */
-    private COSName( String aName, boolean staticValue )
+    private COSName(String aName, boolean staticValue)
     {
         name = aName;
-        if ( staticValue )
+        if (staticValue)
         {
-            commonNameMap.put( aName, this);
+            commonNameMap.put(aName, this);
         }
         else
         {
-            nameMap.put( aName, this );
+            nameMap.put(aName, this);
         }
         hashCode = name.hashCode();
     }
 
     /**
-     * Private constructor.  This will limit the number of COSName objects.
-     * that are created.
-     *
+     * Private constructor. This will limit the number of COSName objects. that are created.
+     * 
      * @param aName The name of the COSName object.
      */
-    private COSName( String aName )
+    private COSName(String aName)
     {
-        this( aName, true );
+        this(aName, true);
     }
 
     /**
      * This will get the name of this COSName object.
-     *
+     * 
      * @return The name of the object.
      */
     public String getName()
@@ -1660,13 +1666,13 @@ public final class COSName extends COSBa
     /**
      * {@inheritDoc}
      */
-    public boolean equals( Object o )
+    public boolean equals(Object o)
     {
         boolean retval = this == o;
-        if( !retval && o instanceof COSName )
+        if (!retval && o instanceof COSName)
         {
-            COSName other = (COSName)o;
-            retval = name == other.name || name.equals( other.name );
+            COSName other = (COSName) o;
+            retval = name == other.name || name.equals(other.name);
         }
         return retval;
     }
@@ -1684,47 +1690,38 @@ public final class COSName extends COSBa
      */
     public int compareTo(COSName other)
     {
-        return this.name.compareTo( other.name );
+        return this.name.compareTo(other.name);
     }
 
-
-
     /**
      * visitor pattern double dispatch method.
-     *
+     * 
      * @param visitor The object to notify when visiting this object.
      * @return any object, depending on the visitor implementation, or null
      * @throws COSVisitorException If an error occurs while visiting this object.
      */
-    public Object accept(ICOSVisitor  visitor) throws COSVisitorException
+    public Object accept(ICOSVisitor visitor) throws COSVisitorException
     {
         return visitor.visitFromName(this);
     }
 
     /**
      * This will output this string as a PDF object.
-     *
+     * 
      * @param output The stream to write to.
      * @throws IOException If there is an error writing to the stream.
      */
-    public void writePDF( OutputStream output ) throws IOException
+    public void writePDF(OutputStream output) throws IOException
     {
         output.write(NAME_PREFIX);
         byte[] bytes = getName().getBytes("ISO-8859-1");
-        for (int i = 0; i < bytes.length;i++)
+        for (int i = 0; i < bytes.length; i++)
         {
-            int current = ((bytes[i]+256)%256);
+            int current = ((bytes[i] + 256) % 256);
 
-            if(current <= 32 || current >= 127 ||
-               current == '(' ||
-               current == ')' ||
-               current == '[' ||
-               current == ']' ||
-               current == '/' ||
-               current == '%' ||
-               current == '<' ||
-               current == '>' ||
-               current == NAME_ESCAPE[0] )
+            if (current <= 32 || current >= 127 || current == '(' || current == ')' || current == '[' || current == ']'
+                    || current == '/' || current == '%' || current == '<' || current == '>'
+                    || current == NAME_ESCAPE[0])
             {
                 output.write(NAME_ESCAPE);
                 output.write(COSHEXTable.TABLE[current]);
@@ -1736,15 +1733,13 @@ public final class COSName extends COSBa
         }
     }
 
-     /**
-      * Not usually needed except if resources need to be reclaimed in a ong
-      * running process.
-      * Patch provided by flester@GMail.com
-      * incorporated 5/23/08, Danielwilson@users.SourceForge.net
-      */
-     public static synchronized void clearResources()
-     {
-         // Clear them all
-         nameMap.clear();
-     }
+    /**
+     * Not usually needed except if resources need to be reclaimed in a long running process. Patch provided by
+     * flester@GMail.com incorporated 5/23/08, Danielwilson@users.SourceForge.net
+     */
+    public static synchronized void clearResources()
+    {
+        // Clear them all
+        nameMap.clear();
+    }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1536136&r1=1536135&r2=1536136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Sun Oct 27 13:59:24 2013
@@ -256,6 +256,26 @@ public class PDPage implements COSObject
     }
 
     /**
+     * This will get the key of this Page in the structural parent tree.
+     * 
+     * @return the integer key of the page's entry in the structural parent tree
+     */
+    public int getStructParents()
+    {
+        return page.getInt(COSName.STRUCT_PARENTS, 0);
+    }
+
+    /**
+     * This will set the key for this page in the structural parent tree.
+     * 
+     * @param structParents The new key for this page.
+     */
+    public void setStructParents(int structParents)
+    {
+        page.setInt(COSName.STRUCT_PARENTS, structParents);
+    }
+
+    /**
      * A rectangle, expressed in default user space units, defining the boundaries of the physical medium on which the
      * page is intended to be displayed or printed
      * 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java?rev=1536136&r1=1536135&r2=1536136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java Sun Oct 27 13:59:24 2013
@@ -20,28 +20,29 @@ import java.io.IOException;
 import java.util.Hashtable;
 import java.util.Map;
 
+import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.pdmodel.common.COSDictionaryMap;
 import org.apache.pdfbox.pdmodel.common.PDNameTreeNode;
+import org.apache.pdfbox.pdmodel.common.PDNumberTreeNode;
 
 /**
  * A root of a structure tree.
- *
- * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>,
- *  <a href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
- * @version $Revision: 1.2 $
+ * 
+ * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>, <a
+ * href="mailto:Johannes%20Koch%20%3Ckoch@apache.org%3E">Johannes Koch</a>
+ * 
  */
 public class PDStructureTreeRoot extends PDStructureNode
 {
 
-    public static final String TYPE = "StructTreeRoot";
-
+    private static final String TYPE = "StructTreeRoot";
 
     /**
      * Default Constructor.
-     *
+     * 
      */
     public PDStructureTreeRoot()
     {
@@ -50,14 +51,60 @@ public class PDStructureTreeRoot extends
 
     /**
      * Constructor for an existing structure element.
-     *
+     * 
      * @param dic The existing dictionary.
      */
-    public PDStructureTreeRoot( COSDictionary dic )
+    public PDStructureTreeRoot(COSDictionary dic)
     {
         super(dic);
     }
 
+    /**
+     * Returns the K array entry.
+     * 
+     * @return the K array entry
+     */
+    public COSArray getKArray()
+    {
+        COSBase k = this.getCOSDictionary().getDictionaryObject(COSName.K);
+        if (k != null)
+        {
+            if (k instanceof COSDictionary)
+            {
+                COSDictionary kdict = (COSDictionary) k;
+                k = kdict.getDictionaryObject(COSName.K);
+                if (k instanceof COSArray)
+                {
+                    return (COSArray) k;
+                }
+            }
+            else
+            {
+                return (COSArray) k;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the K entry.
+     * 
+     * @return the K entry
+     */
+    public COSBase getK()
+    {
+        return this.getCOSDictionary().getDictionaryObject(COSName.K);
+    }
+
+    /**
+     * Sets the K entry.
+     * 
+     * @param k the K value
+     */
+    public void setK(COSBase k)
+    {
+        this.getCOSDictionary().setItem(COSName.K, k);
+    }
 
     /**
      * Returns the ID tree.
@@ -66,8 +113,7 @@ public class PDStructureTreeRoot extends
      */
     public PDNameTreeNode getIDTree()
     {
-        COSDictionary idTreeDic = (COSDictionary) this.getCOSDictionary()
-            .getDictionaryObject(COSName.ID_TREE);
+        COSDictionary idTreeDic = (COSDictionary) this.getCOSDictionary().getDictionaryObject(COSName.ID_TREE);
         if (idTreeDic != null)
         {
             return new PDNameTreeNode(idTreeDic, PDStructureElement.class);
@@ -86,6 +132,31 @@ public class PDStructureTreeRoot extends
     }
 
     /**
+     * Returns the parent tree.
+     * 
+     * @return the parent tree
+     */
+    public PDNumberTreeNode getParentTree()
+    {
+        COSDictionary parentTreeDic = (COSDictionary) this.getCOSDictionary().getDictionaryObject(COSName.PARENT_TREE);
+        if (parentTreeDic != null)
+        {
+            return new PDNumberTreeNode(parentTreeDic, COSBase.class);
+        }
+        return null;
+    }
+
+    /**
+     * Sets the parent tree.
+     * 
+     * @param parentTree the parent tree
+     */
+    public void setParentTree(PDNumberTreeNode parentTree)
+    {
+        this.getCOSDictionary().setItem(COSName.PARENT_TREE, parentTree);
+    }
+
+    /**
      * Returns the next key in the parent tree.
      * 
      * @return the next key in the parent tree
@@ -96,6 +167,16 @@ public class PDStructureTreeRoot extends
     }
 
     /**
+     * Sets the next key in the parent tree.
+     * 
+     * @param parentTreeNextkey the next key in the parent tree.
+     */
+    public void setParentTreeNextKey(int parentTreeNextkey)
+    {
+        this.getCOSDictionary().setInt(COSName.PARENT_TREE_NEXT_KEY, parentTreeNextkey);
+    }
+
+    /**
      * Returns the role map.
      * 
      * @return the role map

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObject.java?rev=1536136&r1=1536135&r2=1536136&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObject.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/xobject/PDXObject.java Sun Oct 27 13:59:24 2013
@@ -24,7 +24,6 @@ import org.apache.commons.logging.LogFac
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSStream;
-
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 import org.apache.pdfbox.pdmodel.common.PDMetadata;
@@ -32,15 +31,14 @@ import org.apache.pdfbox.pdmodel.common.
 
 /**
  * The base class for all XObjects in the PDF document.
- *
+ * 
  * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
  * @author mathiak
  * @author Marcel Kammer
- * @version $Revision: 1.14 $
  */
 public abstract class PDXObject implements COSObjectable
 {
-    
+
     /**
      * Log instance.
      */
@@ -50,40 +48,40 @@ public abstract class PDXObject implemen
 
     /**
      * Standard constructor.
-     *
+     * 
      * @param xobj The XObject dictionary.
      */
     public PDXObject(COSStream xobj)
     {
-        xobject = new PDStream( xobj );
-        xobject.getStream().setName( COSName.TYPE, "XObject" );
+        xobject = new PDStream(xobj);
+        getCOSStream().setItem(COSName.TYPE, COSName.XOBJECT);
     }
 
     /**
      * Standard constuctor.
-     *
+     * 
      * @param xobj The XObject dictionary.
      */
     public PDXObject(PDStream xobj)
     {
         xobject = xobj;
-        xobject.getStream().setName( COSName.TYPE, "XObject" );
+        getCOSStream().setItem(COSName.TYPE, COSName.XOBJECT);
     }
 
     /**
      * Standard constuctor.
-     *
+     * 
      * @param doc The doc to store the object contents.
      */
     public PDXObject(PDDocument doc)
     {
         xobject = new PDStream(doc);
-        xobject.getStream().setName( COSName.TYPE, "XObject" );
+        getCOSStream().setItem(COSName.TYPE, COSName.XOBJECT);
     }
 
     /**
      * Returns the stream.
-     *
+     * 
      * {@inheritDoc}
      */
     public COSBase getCOSObject()
@@ -93,6 +91,7 @@ public abstract class PDXObject implemen
 
     /**
      * Returns the stream.
+     * 
      * @return The stream for this object.
      */
     public COSStream getCOSStream()
@@ -102,6 +101,7 @@ public abstract class PDXObject implemen
 
     /**
      * Returns the stream.
+     * 
      * @return The stream for this object.
      */
     public PDStream getPDStream()
@@ -111,103 +111,125 @@ public abstract class PDXObject implemen
 
     /**
      * Create the correct xobject from the cos base.
-     *
+     * 
      * @param xobject The cos level xobject to create.
-     *
+     * 
      * @return a pdmodel xobject
      * @throws IOException If there is an error creating the xobject.
      */
-    public static PDXObject createXObject( COSBase xobject ) throws IOException
+    public static PDXObject createXObject(COSBase xobject) throws IOException
     {
-        PDXObject retval = commonXObjectCreation(xobject, false);
-        return retval;
+        return commonXObjectCreation(xobject, false);
     }
 
     /**
      * Create the correct xobject from the cos base.
-     *
+     * 
      * @param xobject The cos level xobject to create.
-     * @param isthumb specify if the xobject represent a Thumbnail Image (in this case, the subtype null must be considered as an Image)
+     * @param isthumb specify if the xobject represent a Thumbnail Image (in this case, the subtype null must be
+     * considered as an Image)
      * @return a pdmodel xobject
      * @throws IOException If there is an error creating the xobject.
      */
     protected static PDXObject commonXObjectCreation(COSBase xobject, boolean isThumb)
     {
         PDXObject retval = null;
-        if( xobject == null )
+        if (xobject == null)
         {
             retval = null;
         }
-        else if( xobject instanceof COSStream )
+        else if (xobject instanceof COSStream)
         {
-            COSStream xstream = (COSStream)xobject;
-            String subtype = xstream.getNameAsString( COSName.SUBTYPE );
+            COSStream xstream = (COSStream) xobject;
+            String subtype = xstream.getNameAsString(COSName.SUBTYPE);
             // according to the PDF Reference : a thumbnail subtype must be Image if it is not null
-            if( PDXObjectImage.SUB_TYPE.equals( subtype ) || (subtype == null && isThumb))
+            if (PDXObjectImage.SUB_TYPE.equals(subtype) || (subtype == null && isThumb))
             {
-                PDStream image = new PDStream( xstream );
+                PDStream image = new PDStream(xstream);
                 // See if filters are DCT or JPX otherwise treat as Bitmap-like
                 // There might be a problem with several filters, but that's ToDo until
                 // I find an example
                 List<COSName> filters = image.getFilters();
-                if( filters != null && filters.contains( COSName.DCT_DECODE ) )
+                if (filters != null && filters.contains(COSName.DCT_DECODE))
                 {
                     return new PDJpeg(image);
                 }
-                else if ( filters != null && filters.contains( COSName.CCITTFAX_DECODE ) )
+                else if (filters != null && filters.contains(COSName.CCITTFAX_DECODE))
                 {
                     return new PDCcitt(image);
                 }
-                else if( filters != null && filters.contains(COSName.JPX_DECODE))
+                else if (filters != null && filters.contains(COSName.JPX_DECODE))
                 {
-                    //throw new IOException( "JPXDecode has not been implemented for images" );
-                    //JPX Decode is not really supported right now, but if we are just doing
-                    //text extraction then we don't want to throw an exception, so for now
-                    //just return a PDPixelMap, which will break later on if it is
-                    //actually used, but for text extraction it is not used.
-                    return new PDPixelMap( image );
+                    // throw new IOException( "JPXDecode has not been implemented for images" );
+                    // JPX Decode is not really supported right now, but if we are just doing
+                    // text extraction then we don't want to throw an exception, so for now
+                    // just return a PDPixelMap, which will break later on if it is
+                    // actually used, but for text extraction it is not used.
+                    return new PDPixelMap(image);
                 }
                 else
                 {
                     retval = new PDPixelMap(image);
                 }
             }
-            else if( PDXObjectForm.SUB_TYPE.equals( subtype ) )
+            else if (PDXObjectForm.SUB_TYPE.equals(subtype))
             {
-                retval = new PDXObjectForm( xstream );
+                retval = new PDXObjectForm(xstream);
             }
             else
             {
-                LOG.warn( "Skipping unknown XObject subtype '" + subtype + "'" );
+                LOG.warn("Skipping unknown XObject subtype '" + subtype + "'");
             }
         }
         return retval;
     }
 
     /**
-     * Get the metadata that is part of the document catalog.  This will
-     * return null if there is no meta data for this object.
-     *
+     * Get the metadata that is part of the document catalog. This will return null if there is no meta data for this
+     * object.
+     * 
      * @return The metadata for this object.
      */
     public PDMetadata getMetadata()
     {
         PDMetadata retval = null;
-        COSStream mdStream = (COSStream)xobject.getStream().getDictionaryObject( COSName.METADATA );
-        if( mdStream != null )
+        COSStream mdStream = (COSStream) getCOSStream().getDictionaryObject(COSName.METADATA);
+        if (mdStream != null)
         {
-            retval = new PDMetadata( mdStream );
+            retval = new PDMetadata(mdStream);
         }
         return retval;
     }
 
     /**
-     * Set the metadata for this object.  This can be null.
-     *
+     * Set the metadata for this object. This can be null.
+     * 
      * @param meta The meta data for this object.
      */
-    public void setMetadata( PDMetadata meta )
+    public void setMetadata(PDMetadata meta)
+    {
+        getCOSStream().setItem(COSName.METADATA, meta);
+    }
+
+    /**
+     * This will get the key of this XObject in the structural parent tree. Required if the form XObject is a structural
+     * content item.
+     * 
+     * @return the integer key of the XObject's entry in the structural parent tree
+     */
+    public int getStructParent()
     {
-        xobject.getStream().setItem( COSName.METADATA, meta );
+        return getCOSStream().getInt(COSName.STRUCT_PARENT, 0);
     }
+
+    /**
+     * This will set the key for this XObject in the structural parent tree.
+     * 
+     * @param structParent The new key for this XObject.
+     */
+    public void setStructParent(int structParent)
+    {
+        getCOSStream().setInt(COSName.STRUCT_PARENT, structParent);
+    }
+
 }



Mime
View raw message