private File extractEmbeddedFile(InputStream pdfInputStream, String name) throws IOException
{
PDDocument docWithEmbeddedFile;
docWithEmbeddedFile = PDDocument.load(pdfInputStream);
PDDocumentCatalog catalog = docWithEmbeddedFile.getDocumentCatalog();
PDDocumentNameDictionary names = catalog.getNames();
PDEmbeddedFilesNameTreeNode embeddedFiles = names.getEmbeddedFiles();
Map<String, COSObjectable> embeddedFileNames = embeddedFiles.getNames();
Assert.assertEquals(1, embeddedFileNames.size());
Map.Entry<String, COSObjectable> entry = embeddedFileNames.entrySet().iterator().next();
LOG.info("Processing embedded file " + entry.getKey() + ":");
PDComplexFileSpecification complexFileSpec = (PDComplexFileSpecification) entry.getValue();