// ---------------------------------------------------------------------------
        public void Write(Stream stream)
        {
            using (ZipFile zip = new ZipFile()) {
                zip.AddFile(RESOURCE, "");
                StructuredContent s = new StructuredContent();
                zip.AddEntry(RESULT, s.CreatePdf());
                zip.Save(stream);
            }
        }
 // ---------------------------------------------------------------------------
 public void Write(Stream stream)
 {
     using (ZipFile zip = new ZipFile()) {
     StructuredContent s = new StructuredContent();
     byte[] pdf = s.CreatePdf();
     zip.AddEntry(Utility.ResultFileName(s.ToString() + ".pdf"), pdf);
     TaggedPdfReaderTool reader = new TaggedPdfReaderTool();
     using (MemoryStream ms = new MemoryStream()) {
       reader.ConvertToXml(new PdfReader(pdf), ms);
       StringBuilder sb =  new StringBuilder();
       foreach (byte b in ms.ToArray()) {
     sb.Append((char) b);
       }
       zip.AddEntry(RESULT, sb.ToString());
     }
     zip.Save(stream);
       }
 }
Esempio n. 3
0
// ---------------------------------------------------------------------------
        public void Write(Stream stream)
        {
            using (ZipFile zip = new ZipFile()) {
                StructuredContent s   = new StructuredContent();
                byte[]            pdf = s.CreatePdf();
                zip.AddEntry(Utility.ResultFileName(s.ToString() + ".pdf"), pdf);
                TaggedPdfReaderTool reader = new TaggedPdfReaderTool();
                using (MemoryStream ms = new MemoryStream()) {
                    reader.ConvertToXml(new PdfReader(pdf), ms);
                    StringBuilder sb = new StringBuilder();
                    foreach (byte b in ms.ToArray())
                    {
                        sb.Append((char)b);
                    }
                    zip.AddEntry(RESULT, sb.ToString());
                }
                zip.Save(stream);
            }
        }
 // ---------------------------------------------------------------------------
 public void Write(Stream stream)
 {
     using (ZipFile zip = new ZipFile()) {
     zip.AddFile(RESOURCE, "");
     StructuredContent s = new StructuredContent();
     zip.AddEntry(RESULT, s.CreatePdf());
     zip.Save(stream);
       }
 }