public PDDocument() throws IOException
{
document = new COSDocument();
//First we need a trailer
COSDictionary trailer = new COSDictionary();
document.setTrailer( trailer );
//Next we need the root dictionary.
COSDictionary rootDictionary = new COSDictionary();
trailer.setItem( COSName.ROOT, rootDictionary );
rootDictionary.setItem( COSName.TYPE, COSName.CATALOG );
rootDictionary.setItem( COSName.VERSION, COSName.getPDFName( "1.4" ) );
//next we need the pages tree structure
COSDictionary pages = new COSDictionary();
rootDictionary.setItem( COSName.PAGES, pages );
pages.setItem( COSName.TYPE, COSName.PAGES );
COSArray kidsArray = new COSArray();
pages.setItem( COSName.KIDS, kidsArray );
pages.setItem( COSName.COUNT, new COSInteger( 0 ) );
}