需要将PDF中存在的图像转换为JPG以在ASPX页面上显示 [英] Need To Convert Images Present in PDF Into JPG To Show on ASPX Page

查看:176
本文介绍了需要将PDF中存在的图像转换为JPG以在ASPX页面上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个要求,我需要将PDF文档转换为JPG,以便我可以将JPG渲染到aspx页面。

PDF文档包含扫描图像。当我尝试使用iTextHelp时,如果PDF包含文本,则效果很好。但是,如果PDF文档包含图像,则会创建损坏的JPG文件。



请告诉我这个。



问候

Avi

Hi All,

I have a requirement in which I need to convert PDF document into JPG so that I can render the JPG to aspx page.
The PDF documents contains scanned images. When I try iTextHelp it works well if the PDF contains text .But creates corrupted JPG file if PDF document contains images.

Please let me know on this.

Regards
Avi

推荐答案

快速搜索发现:< br $> b $ b

使用C#和GhostScript将PDF转换为一系列图像[ ^ ]



另外,你应该看一下在这里为GhostScript:



.Net GhostScript Wrapper - 源代码 [ ^ ]



具体来说,这个例子



A quick search found this:

Convert a PDF into a Series of Images using C# and GhostScript[^]

Also, you should look at the for GhostScript here:

.Net GhostScript Wrapper - Source Code[^]

Specifically, this example

// 2) Convert .pdf file to series of .jpg files
//    (In this case the output file is not specified, so all the pages will be converted)
  

    lock (typeof(BrighterTools.GhostScript))
    {
        GC.Collect();
        
        // Select output device  
        BrighterTools.GhostScript.OutputDevice outputDevice = GhostScript.OutputDevice.jpeg;
        // Select output device options
        BrighterTools.GhostScript.DeviceOption[] deviceOptions = BrighterTools.GhostScript.DeviceOptions.jpg(100);
    
        using (BrighterTools.GhostScript ghostScript = new BrighterTools.GhostScript(GhostScriptFolder))
        {
            OutputFilenames = ghostScript.Convert(outputDevice, deviceOptions, InputFilename, OutputFolder, String.Empty, TempFolder, OutputResolution);
        }
     }


这篇关于需要将PDF中存在的图像转换为JPG以在ASPX页面上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆