private static void SaveAsPdf(XpsDocumentSplicer xpsDocumentSplicer, string outputDirectory) { string tempXpsSavePath = GetTempXpsSavePath(); xpsDocumentSplicer.SaveSplicedXpsDocumentTo(tempXpsSavePath); ConvertXpsToPdf(tempXpsSavePath, outputDirectory); File.Delete(tempXpsSavePath); }
private static FileStream GetAsPdfFileStream(XpsDocumentSplicer xpsDocumentSplicer) { string tempXpsSavePath = GetTempXpsSavePath(); string tempPdfSavePath = GetTempPdfSavePath(); xpsDocumentSplicer.SaveSplicedXpsDocumentTo(tempXpsSavePath); ConvertXpsToPdf(tempXpsSavePath, tempPdfSavePath); FileStream pdfFileStream = File.Open(tempPdfSavePath, FileMode.OpenOrCreate); File.Delete(tempPdfSavePath); File.Delete(tempXpsSavePath); return(pdfFileStream); }