PDStream fontStream = new PDStream(doc, stream, false );
fontStream.getStream().setInt( COSName.LENGTH1, fontStream.getByteArray().length );
fontStream.addCompression();
fd.setFontFile2( fontStream );
// As the stream was close within the PDStream constructor, we have to recreate it
stream = fontStream.createInputStream();
try
{
retval.loadDescriptorDictionary(fd, stream);
}
finally