Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Reporting Services 2008 – Embedding a PDF Document

By , 29 Mar 2009
ReportingServiceEmbedPDF.zip
CodeCamp2009
bin
Debug
ConvertToImage_cs.vshost.exe.manifest
PDFParser.dll
GetPDF
bin
Debug
SqlClassLibrary.dll
GetPDF.csproj.user
Properties
Test Scripts
PDFParser
bin
Debug
PDFParser.dll
Properties
Report
DataSource1.rds
PDF - Backup.rdl
PDF.rdl
Report.rptproj
Report.rptproj.user
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using TallComponents.PDF.Rasterizer;
using System.IO;

namespace PDFParser
{
    public class Parse
    {
        public List<Image> Split(byte[] document)
        {
            Document pdfDoc = new Document(new BinaryReader(new MemoryStream(document)));
            Page page = null;
            List<Image> returnVal = new List<Image>();

            for (int i = 0; i < pdfDoc.Pages.Count; i++)
            {
                page = pdfDoc.Pages[i];
                using (Bitmap bitmap = new Bitmap((int)page.Width, (int)page.Height))
                {
                    Graphics graphics = Graphics.FromImage(bitmap);
                    graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
                    page.Draw(graphics);
                    returnVal.Add((Image)bitmap.Clone());
                }
            }

            return returnVal;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Steve MunLeeuw
Software Developer SI&A Corp
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 29 Mar 2009
Article Copyright 2009 by Steve MunLeeuw
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid