Пример #1
0
 /// <summary>
 /// Exports the specified document.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="filename">The filename.</param>
 public void Export(AODL.Document.IDocument document, string filename)
 {
     try
     {
         this._document = document;
         string targDir = Environment.CurrentDirectory;
         int    index   = filename.LastIndexOf(@"\");
         if (index != -1)
         {
             targDir = filename.Substring(0, index);
         }
         string pictures  = "\\Pictures";
         string imgfolder = targDir + "\\" + this._imgFolder;
         if (!Directory.Exists(imgfolder + pictures))
         {
             Directory.CreateDirectory(imgfolder + pictures);
         }
         this.CopyGraphics(this._document, imgfolder);
         string htmlsite = this.AppendHtml(this._document.Content, this.GetTemplate());
         this.WriteHtmlFile(filename, htmlsite);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
 /// <summary>
 /// Exports the specified document.
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="filename">The filename.</param>
 public void Export(AODL.Document.IDocument document, string filename)
 {
     try
     {
         PDFDocument pdfDocument = new PDFDocument();
         pdfDocument.DoExport(document, filename);
         if (this.OnExportFinished != null)
         {
             this.OnExportFinished();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }