예제 #1
0
        private static void SaveAsPdf(XpsDocumentSplicer xpsDocumentSplicer, string outputDirectory)
        {
            string tempXpsSavePath = GetTempXpsSavePath();

            xpsDocumentSplicer.SaveSplicedXpsDocumentTo(tempXpsSavePath);
            ConvertXpsToPdf(tempXpsSavePath, outputDirectory);
            File.Delete(tempXpsSavePath);
        }
예제 #2
0
        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);
        }