Ejemplo n.º 1
0
        private static void ReleasePageStream(int pageNumber, Stream pageStream)
        {
            pageStream.Dispose();

            string imageFilePath = GenerateDocumentPagesPreview.GetImagePath(pageNumber);

            Console.WriteLine("Image file '{0}' is ready for preview.", imageFilePath);
        }
Ejemplo n.º 2
0
        private static Stream CreatePageStream(int pageNumber)
        {
            string imageFilePath = GenerateDocumentPagesPreview.GetImagePath(pageNumber);

            var folder = Path.GetDirectoryName(imageFilePath);

            if (!Directory.Exists(folder))
            {
                Directory.CreateDirectory(folder);
            }

            return(new FileStream(imageFilePath, FileMode.Create));
        }