How to convert PDF files to images

前端 未结 12 553
庸人自扰
庸人自扰 2020-11-27 14:46

I need to convert PDF files to images. If the PDF file is multi-page,I just need one image that contains all of the PDF pages.

Is there an open sou

12条回答
  •  孤独总比滥情好
    2020-11-27 15:29

    There is a free nuget package (Pdf2Image), which allows the extraction of pdf pages to jpg files or to a collection of images (List ) in just one line

            string file = "c:\\tmp\\test.pdf";
    
            List images = PdfSplitter.GetImages(file, PdfSplitter.Scale.High);
    
            PdfSplitter.WriteImages(file, "c:\\tmp", PdfSplitter.Scale.High, PdfSplitter.CompressionLevel.Medium);
    

    All source is also available on github Pdf2Image

提交回复
热议问题