Exemple #1
0
        public ISavableDocument Process(PdfProcessSource source, IEnumerable<int> pages, bool closeSource = false)
        {
            using (var pdf = new PdfDocument()) {

                pdf.Pages.AddRange(GenerateFromSource(source, pages, pdf, closeSource));

                return new PdfSharpSavableDocument(pdf);
            }
        }
Exemple #2
0
        public IEnumerable<PdfPage> GenerateFromSource(PdfProcessSource source, int angle, PdfDocument output, bool closeSource = false)
        {
            foreach (var page in GenerateFromStream(source.Stream, angle, output)) {
                yield return page;
            }

            if (closeSource) {
                source.Stream.Close();
            }
        }