public DoExport ( IDocument document, string fileName ) : void | ||
document | IDocument | The document. |
fileName | string | Name of the file. |
return | void |
public void DoExport(IDocument document, string fileName)
{
try
{
this.LoadDefaultStyles(document);
this.CreatePDFDocument(fileName);
ArrayList pdfElements = MixedContentConverter.GetMixedPdfContent(document.Content);
foreach(object pdfElement in pdfElements)
{
if (pdfElement is AODL.ExternalExporter.PDF.Document.iTextExt.ParagraphExt
&& ((AODL.ExternalExporter.PDF.Document.iTextExt.ParagraphExt)pdfElement).PageBreakBefore)
this._document.NewPage();
this._document.Add(pdfElement as iTextSharp.text.IElement);
if (pdfElement is AODL.ExternalExporter.PDF.Document.iTextExt.ParagraphExt
&& ((AODL.ExternalExporter.PDF.Document.iTextExt.ParagraphExt)pdfElement).PageBreakAfter)
this._document.NewPage();
}
this._document.Close();
}
catch(Exception)
{
throw;
}
}
/// <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; } }