Beispiel #1
0
        public virtual DocumentInformation BuildDocumentInformation(byte[] document)
        {
            var informationDocument = new byte[document.Length];

            document.CopyTo(informationDocument, 0);

            using (var archive = _zipFactory.ZipArchiveFromDocument(document))
            {
                var fileType = _zipHandlerService.GetFileType(archive);
                var content  = _zipHandlerService.GetEntryAsString(archive, "content.xml");
                var metaXml  = _zipHandlerService.GetEntryAsString(archive, "meta.xml");

                var metadata = _buildOdfMetadataService.BuildOdfMetadata(metaXml, _manager, _ixDocumentParserService);

                var information = new DocumentInformation(fileType, informationDocument, content, metadata);

                return(information);
            }
        }