有人可以提供代码,使用pdfsharp从pdf文件中提取图像 [英] can someone supply code to extract an image from pdf file using pdfsharp

查看:631
本文介绍了有人可以提供代码,使用pdfsharp从pdf文件中提取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试过pdfsharp和itextsharp。我更喜欢pdfsharp,但似乎没有人完成从pdf文件中提取图像并以jpeg格式保存它的示例代码,对我来说最重要的是,包括提取图像的高度和宽度属性。



我已经尝试过文档中显示的示例代码,但它对我不起作用。我确信有人已完成文档中显示的不完整代码。你能带我去看那个代码吗?



我已经在visual studio 2012中使用vb.net成功编写了使用pdfsharp编写PDF文件的代码,但我使用的形式提取了图像提取整个页面。我只想要图片。

I have tried pdfsharp and itextsharp. I prefer pdfsharp, however no one seemed to finish the sample code for extracting an image from a pdf file and saving it in jpeg format and most importantly for me, to include the height and width properties of the extracted image.

I have tried the sample code shown in the documentation but it doesn't work for me. I am sure someone has completed the incomplete code shown in the documentation. Can you lead me to that code?

I have successfully written code creating PDF files using pdfsharp using vb.net in visual studio 2012 but I extracted the image using form which extracts the whole page. I want just the image.

推荐答案

查看此文档和示例源代码

http://www.pdfsharp.net/wiki/ExportImages-sample.ashx?AspxAutoDetectCookieSupport=1 [ ^ ]



示例源代码在C#中,您可以使用任何在线代码转换器转换为VB.Net,例如

http:/ /converter.telerik.com [ ^ ]



希望,它有帮助:)
Check this documentation and sample source code
http://www.pdfsharp.net/wiki/ExportImages-sample.ashx?AspxAutoDetectCookieSupport=1[^]

Sample source code is in C# which you can convert to VB.Net using any online code converter like
http://converter.telerik.com[^]

Hope, it helps :)


对不起,这与您原来的问题无关,但可能是解决方案1的有用补充。



有一种更好的方式来翻译任何项目(整个项目,真实的ly),在C#和VB.NET之间。这是开源的ILSpy。您编译一个程序集获取结果模块并在ILSpy中打开它,然后选择不同的语言并反汇编它。生成的代码的质量高于所有期望。更重要的是,这是一个完整的项目代码,保证编译和工作完全一样。



请参阅我过去的答案以获取更多详细信息:代码解释,C#到VB.NET [ ^ ]。



-SA
Sorry, this is unrelated to your original question, but might be a helpful addition to the Solution 1.

There is a better way to translate any project (a whole project, really), between C# and VB.NET. This is open-source ILSpy. You compile one assembly take resulting module and open it in ILSpy, then select different language and disassemble it. The quality of the generated code is above all the expectations. More importantly, this is a complete project code, guaranteed to compile and work exactly as the original one.

Please see my past answer for some more detail: Code Interpretation, C# to VB.NET[^].

—SA


这篇关于有人可以提供代码,使用pdfsharp从pdf文件中提取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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