IInputStream stream
) throws FileFormatException
{
reader = new Reader(stream, this);
FileInfo info = reader.readInfo();
version = info.getVersion();
trailer = info.getTrailer();
if(trailer.containsKey(PdfName.Encrypt)) // Encrypted file.
throw new NotImplementedException("Encrypted files are currently not supported.");
indirectObjects = new IndirectObjects(this, info.getXrefEntries());
document = new Document(trailer.get(PdfName.Root));
document.getConfiguration().setXrefMode(PdfName.XRef.equals(trailer.get(PdfName.Type)) ? XRefModeEnum.Compressed : XRefModeEnum.Plain);
}