How would ya\'ll recommend that I convert a FlowDocument to PDF to be attached to an EMail?
The FlowDocument is dynamic, not static.
I would prefer to be able to
I managed to get this working with the PDFCreator printer driver. You need to install the driver for this to work, so it may not be an ideal solution for some people. There is a COM interface available. The code more or less looks something like this:
PDFCreator.clsPDFCreator _PDFCreator;
PDFCreator.clsPDFCreatorError pErr;
if (_PDFCreator.cStart(parameters, false))
{
_PDFCreator.cClearCache();
_PDFCreator.set_cOption("UseAutosave", 1);
_PDFCreator.cPrinterStop = false;
}
_PDFCreator.set_cOption("AutosaveFilename", file);
_PDFCreator.set_cOption("AutosaveDirectory", folder);
PrintDialog printDialog = new PrintDialog();
printDialog.PrintDocument(((IDocumentPaginatorSource)flowDoc).DocumentPaginator, "Report");