1 package com.etymon.pjx.util; 2 3 import com.etymon.pjx.*; 6 7 11 public class PdfCatalog { 12 13 17 protected static final PdfName PDFNAME_ROOT = new PdfName("Root"); 18 19 22 protected PdfManager _m; 23 24 28 public PdfCatalog(PdfManager manager) { 29 30 _m = manager; 31 32 } 33 34 39 public PdfReference getCatalog() throws PdfFormatException { 40 synchronized (this) { 41 synchronized (_m) { 42 43 PdfDictionary trailer = _m.getTrailerDictionary(); 44 45 Object obj = trailer.getMap().get(PDFNAME_ROOT); 46 47 if ( !(obj instanceof PdfReference) ) { 48 throw new PdfFormatException("Catalog dictionary is not an indirect reference."); 49 } 50 51 return (PdfReference)obj; 52 53 } 54 } 55 } 56 57 } 58 | Popular Tags |