我想使用ItextSharp lib转换图像中的Pdf页面.
知道如何转换图像文件中的每个页面
我有一些文件.它的格式是PDF.现在有一个项目,这个项目需要将PDF文件转换为Image.如果PDF是多页,我只需要一个包含所有PDF页面的图像.我从谷歌得到了一些答案,但有些工具是收费的.
那么,如何用C#解决呢?非常感谢你!
我知道,在C#中使用Acrobat.dll可以解决这个问题,但它必须安装Adobe Acrobat并且它不是免费的.
我正在尝试创建一个将doc/docx转换为png格式的Web服务.
我似乎遇到的问题是我找不到任何可以满足我需要的库或其他东西,考虑到我正在寻找免费的东西而不依赖于Office(应用程序将运行的服务器没有安装Office) ).
有什么能帮助我获得这个吗?或者我必须选择使用依赖于办公室的东西(比如Interop - 我读的哪个在服务器上使用真的很糟糕)或者不是免费的东西?
谢谢
我正在尝试使用 GhostScript 从 pdf 创建图像。这是我的代码:
GhostscriptWrapper.ConvertToBMP(inputPDFFilePath, outputBMPFilePath);
Run Code Online (Sandbox Code Playgroud)
这是我的GhostscriptWrapper课:
public class GhostscriptWrapper
{
public static void ConvertToBMP(string inputPath, string outputPath)
{
CallAPI(GetArgs(inputPath, outputPath));
}
private static void CallAPI(string[] args)
{
IntPtr ptr;
CreateAPIInstance(out ptr, IntPtr.Zero);
InitAPI(ptr, args.Length, args);
Cleanup(ptr);
}
private static void Cleanup(IntPtr gsInstancePtr)
{
ExitAPI(gsInstancePtr);
DeleteAPIInstance(gsInstancePtr);
}
[DllImport("gsdll32.dll", EntryPoint="gsapi_new_instance")]
private static extern int CreateAPIInstance(out IntPtr pinstance,
IntPtr caller_handle);
[DllImport("gsdll32.dll", EntryPoint="gsapi_delete_instance")]
private static extern void DeleteAPIInstance(IntPtr instance);
[DllImport("gsdll32.dll", EntryPoint="gsapi_exit")]
private static extern int ExitAPI(IntPtr instance);
[DllImport("gsdll32.dll", EntryPoint="gsapi_init_with_args")]
private …Run Code Online (Sandbox Code Playgroud) c# ×4
asp.net ×2
pdf ×2
ghostscript ×1
image ×1
itextsharp ×1
ms-word ×1
png ×1
web-services ×1