以下线程适合您的要求。
将pdf文件转换为jpeg图像
一种解决方案是使用第三方库。ImageMagick非常受欢迎,也可以免费获得。您可以在这里获得.NET包装器。原始的ImageMagick下载页面在这里。
- http://www.preproject.com/KB/library/pdftoimages.aspx使用Solid framework将PDF页面转换为图像文件(无效链接,已删除的文档可从Internet存档上获得)。
- http://www.print-driver.com/howto/convert_pdf_to_jpeg.html通用文档转换器
- http://www.makeuseof.com/tag/6-ways-to-convert-a-pdf-file-to-a-jpg-image/ 6种将PDF转换为JPG图像的方法
您还可以看一下该线程:
如何在C#中通过pictureBox中的pdf文件打开页面
如果使用此过程将PDF转换为tiff,则可以使用此类从tiff检索位图。
public class TiffImage{ private string myPath; private Guid myGuid; private frameDimension myDimension; public ArrayList myImages = new ArrayList(); private int myPageCount; private Bitmap myBMP; public TiffImage(string path) { MemoryStream ms; Image myImage; myPath = path; FileStream fs = new FileStream(myPath, FileMode.Open); myImage = Image.FromStream(fs); myGuid = myImage.frameDimensionsList[0]; myDimension = new frameDimension(myGuid); myPageCount = myImage.GetframeCount(myDimension); for (int i = 0; i < myPageCount; i++) { ms = new MemoryStream(); myImage.SelectActiveframe(myDimension, i); myImage.Save(ms, ImageFormat.Bmp); myBMP = new Bitmap(ms); myImages.Add(myBMP); ms.Close(); } fs.Close(); }}像这样使用它:
private void button1_Click(object sender, EventArgs e){ TiffImage myTiff = new TiffImage("D:\Some.tif"); //imageBox is a PictureBox control, and the [] operators pass back //the Bitmap stored at that position in the myImages ArrayList in the TiffImage this.pictureBox1.Image = (Bitmap)myTiff.myImages[0]; this.pictureBox2.Image = (Bitmap)myTiff.myImages[1]; this.pictureBox3.Image = (Bitmap)myTiff.myImages[2];}


