Total PDF Converter X是将PDF文件转换为其他格式在Web服务器上的正确解决方案。
Windows
2000/2003/Vista
7/8/10/11
and
2012/2016/2019/2022 Server
and
Docker/Citrix/Wine
Total PDF Converter X (SDK) 是一个 PDF 软件开发工具包,用于在网络服务器上将 PDF 转换为 DOC、RTF、XLS、HTML、EPS、PS、TXT、CSV 或图像(BMP、JPEG、GIF、WMF、EMF、PNG、TIFF)。可用于将 PDF 文件转换能力添加到您自己的应用程序中。Total PDF ConverterX (SDK) 可以集成到服务器和桌面/客户端应用程序中。 购买 Total PDF Converter 开发工具包,您将获得命令行工具和ActiveX。它没有 GUI 或任何中断消息。
针对每种转换类型提供了不同的设置。 Total PDF ConverterX 可以以2种方式处理多页 PDF 文件:要么将 PDF 转换为一个目标文件,要么提取每一页并将其转换为目标格式。该程序还可以将多个 PDF 文件合并为一个图像。
使用 Total PDF ConverterX 来增强现有应用程序需要最小的努力。所有功能已包含在代码中,您只需选择必要的部分并稍作调整后粘贴到应用程序代码中。我们数百位客户已经成功地在其应用程序中实施了PDF转换选项。立即获得您的副本——下载中包括命令行转换器和 ActiveX。
string src="C:\\test\\Source.PDF";
string dest="C:\\test\\Dest.TIFF";
PDFConverterX Cnv = new PDFConverterX();
Cnv.Convert(src, dest, "-c TIFF -log c:\\test\\PDF.log");
MessageBox.Show("Convert complete!");
//与表单一起工作
Cnv.LoadFromFile(src);
Cnv.SetFormFieldValue(0, "Test Name");
Cnv.SaveToFile(src);
public static class Function1
{
[FunctionName("Function1")]
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
StringBuilder sbLogs = new StringBuilder();
sbLogs.AppendLine("started...");
try
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
var assemblyDirectoryPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
assemblyDirectoryPath = assemblyDirectoryPath.Substring(0, assemblyDirectoryPath.Length - 4);
var executablePath = $@"{assemblyDirectoryPath}\Converter\PDFConverterX.exe";
sbLogs.AppendLine(executablePath + "...");
var msgPath = $@"{assemblyDirectoryPath}\MSG\MSG.pdf";
var outPath = Path.GetTempFileName() + ".tiff";
startInfo.FileName = executablePath;
if (File.Exists(outPath))
{
File.Delete(outPath);
}
if (File.Exists(executablePath) && File.Exists(msgPath))
{
sbLogs.AppendLine("files exists...");
}
else
sbLogs.AppendLine("EXE & MSG files NOT exists...");
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = $"{msgPath} {outPath}";
using (Process exeProcess = Process.Start(startInfo))
{
sbLogs.AppendLine($"wait...{DateTime.Now.ToString()}");
exeProcess.WaitForExit();
sbLogs.AppendLine($"complete...{DateTime.Now.ToString()}");
}
int sleepCounter = 10;
while(!File.Exists(outPath) && sleepCounter > 0)
{
System.Threading.Thread.Sleep(1000);
sbLogs.AppendLine("sleep...");
sleepCounter--;
}
if (File.Exists(outPath))
sbLogs.AppendLine("Conversion complete successfully.");
}
catch (Exception ex)
{
sbLogs.AppendLine(ex.ToString());
}
return new OkObjectResult(sbLogs);
}
}
#include <windows.h>
static const CLSID CLSID_PDFConverterX =
{0x6B411E7E, 0x9503,0x4793,{0xA2, 0x87, 0x1F, 0x3B, 0xA8, 0x78, 0xB9, 0x1C}};
static const IID IID_IPDFConverterX =
{0xEF633BED, 0xC414,0x49B0,{0x91, 0xFB, 0xC3, 0x9C, 0x3F, 0xE0, 0x08, 0x0D}};
#undef INTERFACE
#define INTERFACE IPDFConverterX
DECLARE_INTERFACE_(IPDFConverterX, IDispatch)
{
STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
STDMETHOD(Convert)(THIS_ LPCTSTR, LPCTSTR, LPCTSTR) PURE;
STDMETHOD(About)(THIS) PURE;
//const SourceFile: WideString; const DestFile: WideString; const Params: WideString; safecall;
};
typedef HRESULT (__stdcall *hDllGetClassObjectFunc) (REFCLSID, REFIID, void **);
int main () {
HRESULT hr;
if (CoInitialize(NULL)) {
printf ("Error in CoInitialize.");
return -1;
}
LPCTSTR lpFileName = "PDFConverter.dll";
HMODULE hModule;
hModule = LoadLibrary (lpFileName);
printf ("hModule: %d\n", hModule);
if (hModule == 0) {
printf ("Error in LoadLibrary.");
return -1;
}
hDllGetClassObjectFunc hDllGetClassObject = NULL;
hDllGetClassObject = (hDllGetClassObjectFunc) GetProcAddress (hModule, "DllGetClassObject");
if (hDllGetClassObject == 0) {
printf ("Error in GetProcAddress.");
return -1;
}
IClassFactory *pCF = NULL;
hr = hDllGetClassObject (&CLSID_PDFConverterX, &IID_IClassFactory, (void **)&pCF);
/* Can't load with different ID */
printf ("hr hDllGetClassObject: %d\n", hr);
if (!SUCCEEDED (hr)) {
printf ("Error in hDllGetClassObject.");
return -1;
}
IPDFConverterX *pIN;
hr = pCF->lpVtbl->CreateInstance (pCF, 0, &IID_IPDFConverterX, (void **)&pIN);
printf ("hr CreateInstance: %d\n", hr);
if (!SUCCEEDED (hr)) {
printf ("Error in hDllGetClassObject.");
return -1;
}
hr = pCF->lpVtbl->Release (pCF);
printf ("hr Release: %d\n", hr);
if (!SUCCEEDED (hr)) {
printf ("Error in Release.");
return -1;
}
hr = pIN->lpVtbl->About (pIN);
printf ("hr About: %d\n", hr);
if (!SUCCEEDED (hr)) {
printf ("Error in About.");
return -1;
}
hr = pIN->lpVtbl->Convert (pIN, "test.pdf", "test.html","-cHTML");
printf ("hr Convert: %d\n", hr);
if (!SUCCEEDED (hr)) {
printf ("Error in Convert.");
return -1;
}
return 0;
}
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
C.Convert "c:\source.PDF", "c:\dest.HTML", "-cHTML -log c:\pdf.log"
set C = nothing
dim C
Set C=CreateObject("PDFConverter.PDFConverterX")
Response.Clear
Response.AddHeader "Content-Type", "binary/octet-stream"
Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.TIFF"
Response.BinaryWrite c.ConvertToStream("C:\www\ASP\Source.PDF", "C:\www\ASP", "-cTIFF -log c:\PDF.log")
set C = nothing
$src="C:\\test.pdf";
$dest="C:\\test.tiff";
if (file_exists($dest)) unlink($dest);
$c= new COM("PDFConverter.PDFConverterX");
$c->convert($src,$dest, "-c TIFF -log c:\doc.log");
if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;
require 'win32ole'
c = WIN32OLE.new('PDFConverter.PDFConverterX')
src="C:\\test\\test.pdf";
dest="C:\\test\\test.tiff";
c.convert(src,dest, "-c TIFF -log c:\\test\\PDF.log");
if not File.exist?(dest)
puts c.ErrorMessage
end
import win32com.client
import os.path
c = win32com.client.Dispatch("PDFConverter.PDFConverterX")
src="C:\\test\\test.pdf";
dest="C:\\test\\test.tiff";
c.convert(src, dest, "-c TIFF -log c:\\test\\PDF.log");
if not os.path.exists(file_path):
print(c.ErrorMessage)
uses Dialogs, Vcl.OleAuto;
var
c: OleVariant;
begin
c:=CreateOleObject('PDFConverter.PDFConverterX');
C.Convert('c:\test\source.pdf', 'c:\test\dest.tiff', '-c TIFF -log c:\test\PDF.log');
IF c.ErrorMessage<> Then
ShowMessage(c.ErrorMessage);
end;
var c = new ActiveXObject("PDFConverter.PDFConverterX");
c.Convert("C:\\test\\source.pdf", "C:\\test\\dest.tiff", "-c TIFF");
if (c.ErrorMessage!="")
alert(c.ErrorMessage)
use Win32::OLE; my $src="C:\\test\\test.pdf"; my $dest="C:\\test\\test.tiff"; my $c = CreateObject Win32::OLE 'PDFConverter.PDFConverterX'; $c->convert($src,$dest, "-c TIFF -log c:\\test\\PDF.log"); print $c->ErrorMessage if -e $dest;
"到目前为止,该工具正确完成了任务,即在Windows计划任务中使用命令行将PDF文件转换为Excel文件,如果我遇到任何问题,我一定会联系你。"
Sofiane Hamri
"非常感谢你的帮助。Total PDF ConverterX运行得很好。当你的一个竞争对手的产品在从Windows服务运行时会挂掉时,这是一个非常需要的修复。你的合作和快速响应在帮助我们赶上客户的截止日期方面真的是一个生命的救星。"
Michael J. Balmer, 首席集成工程师
www.QuestDiagnostics.com
Developers and IT teams that integrate PDF conversion into server applications via ActiveX and command line
Add PDF-to-DOC and PDF-to-image conversion to your web app
Web developers integrate Total PDF ConverterX via ActiveX into ASP, PHP, or .NET applications. Users upload PDF files through a browser, the server converts them to DOC, XLS, HTML, or images silently with no GUI, and delivers the result — ready-to-use sample code is included to speed up integration.
Convert PDFs automatically within document management systems
Document management and enterprise content platforms use Total PDF ConverterX to convert uploaded PDFs to TIFF for archival, to text for full-text indexing, or to images for preview thumbnails. The SDK plugs into existing workflows with minimal code changes and handles password-protected PDFs when credentials are supplied.
Convert thousands of PDFs on servers without user interaction
Enterprise IT teams run Total PDF ConverterX via command line in scheduled batch jobs. Incoming PDFs are converted to DOC for editing, CSV for data extraction, or EPS for prepress — all unattended. Multi-page PDFs can be split into individual page files or combined into a single output document per folder.
Convert PDF files to TIFF, JPEG, and EPS for print workflows
Print shops and prepress departments convert PDF files to high-quality TIFF, JPEG, or EPS images on production servers. Control paper orientation, output quality, and image size per job. Process multi-page PDFs as individual page images or combine several PDFs into one multi-page TIFF for imposition.
Embed PDF conversion into your desktop or server software
Software vendors embed Total PDF ConverterX into their own products to add PDF export capabilities without building a conversion engine from scratch. The ActiveX interface provides all conversion features through simple API calls, and hundreds of developers have already integrated it into commercial applications.
|
|
|