Пример #1
0
        static void Main(string[] args)
        {
            string supportPath = "..\\..\\..\\..\\..\\..\\SupportFiles\\";

            FileStream       fs       = File.OpenRead(supportPath + "PDF4NET.pdf");
            PDFFixedDocument document = new PDFFixedDocument(fs);

            fs.Close();

            PDFDocumentRenderer documentRenderer = new PDFDocumentRenderer(document);

            PDFRendererSettings settings = new PDFRendererSettings(144, 144);

            settings.RenderingSurface = new PDFRgbRenderingSurface(1224, 1584);

            // Output will be a 24bit RGB multipage TIFF
            FileStream tiffStream = File.Create("PDF4NET.tif");

            documentRenderer.ConvertToMultipageImage("0-3", settings, PDFPageImageFormat.TiffLzwCompressed, tiffStream);
            tiffStream.Flush();
            tiffStream.Close();
        }
Пример #2
0
        static void Main(string[] args)
        {
            string supportPath = "..\\..\\..\\..\\..\\..\\SupportFiles\\";

            FileStream       fs       = File.OpenRead(supportPath + "PDF4NET.pdf");
            PDFFixedDocument document = new PDFFixedDocument(fs);

            fs.Close();

            PDFDocumentRenderer documentRenderer = new PDFDocumentRenderer(document);

            PDFRendererSettings           settings  = new PDFRendererSettings(144, 144);
            PDFBlackWhiteRenderingSurface bwSurface = new PDFBlackWhiteRenderingSurface();

            bwSurface.BinarizationFilter = new PDFFloydSteinbergDitheringFilter();
            settings.RenderingSurface    = bwSurface;

            // Output will be a 1bit B/W CCIT G4 compressed multipage TIFF
            FileStream tiffStream = File.Create("PDF4NET.tif");

            documentRenderer.ConvertToMultipageImage("0-3", settings, PDFPageImageFormat.Tiff, tiffStream);
            tiffStream.Flush();
            tiffStream.Close();
        }