电子表格程序非常适合操作表格数据,但通常需要将其内容转换为其他格式,如PDF,以便于共享、演示或存档数据。手动转换这些文件,尤其是当它们数量巨大或需要定期转换时,是一种耗时的错误操作,急需自动化解决。
我们的Total Excel Converter X软件是您想要批量通过命令行将XLSX转换为PDF时的逻辑工具。该程序集成了Total Excel Converter用户习惯的所有功能,并通过支持基于服务器的转换和通过ActiveX集成到Web应用程序中增加了额外的强大功能。
无论您是在寻找命令行XLSX转换器还是可以直接从您自己的应用程序调用的服务器XLSX转换器,Total Excel Converter X都能满足您的需求。以下是提供的一些高级功能:
当您想要充分利用程序化转换解决方案的全部功能时,您最不希望的就是被一连串的系统消息打断。
Total Excel Converter X通过命令行或与您的应用程序集成无缝运行,因此您不必坐在那里监视其运行。遇到的任何错误消息将被静默记录到一个易于阅读的日志文件中,您可以稍后在闲暇时检查,以便进行故障排除。
我们相信Total Excel Converter X将在您的文档转换工作流中引入全新的程序化能力,并鼓励您在购买前先进行试用。立即下载您的免费试用版,亲自发现它的全部功能!
string src="C:\\test\\Source.xlsx"; string dest="C:\\test\\Dest.PDF"; ExcelConverterX Cnv = new ExcelConverterX(); Cnv.Convert(src, dest, "-c PDF -log c:\\test\\Excel.log"); MessageBox.Show("转换完成!");
public static class Function1 { [FunctionName("Function1")] public static async TaskRun( [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\ExcelConverterX.exe"; sbLogs.AppendLine(executablePath + "..."); var msgPath = $@"{assemblyDirectoryPath}\MSG\MSG-1.xlsx"; var outPath = Path.GetTempFileName() + ".pdf"; 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); } }
dim C Set C=CreateObject("ExcelConverter.ExcelConverterX") C.Convert "c:\test\source.xlsx", "c:\test\dest.pdf", "-cPDF -log c:\test\Excel.log" Response.Write C.ErrorMessage set C = nothing
dim C Set C=CreateObject("ExcelConverter.ExcelConverterX") Response.Clear Response.AddHeader "Content-Type", "binary/octet-stream" Rresponse.AddHeader "Content-Disposition", "attachment; filename=test.pdf" Response.BinaryWrite c.ConvertToStream("C:\www\ASP\Source.xlsx", "C:\www\ASP", "-cpdf -log c:\html.log") set C = nothing
$src="C:\\test\\test.XLS"; $dest="C:\\test\\test.CSV"; if (file_exists($dest)) unlink($dest); $c= new COM("ExcelConverter.ExcelConverterX"); $c->convert($src,$dest, "-c csv -log c:\\test\\xls.log"); if (file_exists($dest)) echo "OK"; else echo "fail:".$c->ErrorMessage;
require 'win32ole' c = WIN32OLE.new('ExcelConverter.ExcelConverterX') src="C:\\test\\test.xlsx"; dest="C:\\test\\test.pdf"; c.convert(src,dest, "-c PDF -log c:\\test\\Excel.log"); if not File.exist?(dest) puts c.ErrorMessage end
import win32com.client import os.path c = win32com.client.Dispatch("ExcelConverter.ExcelConverterX") src="C:\\test\\test.xlsx"; dest="C:\\test\\test.pdf"; c.convert(src, dest, "-c PDF -log c:\\test\\Excel.log"); if not os.path.exists(file_path): print(c.ErrorMessage)
uses Dialogs, Vcl.OleAuto; var c: OleVariant; begin c:=CreateOleObject('ExcelConverter.ExcelConverterX'); C.Convert('c:\test\source.xlsx', 'c:\test\dest.pdf', '-cPDF -log c:\test\Excel.log'); IF c.ErrorMessage<> Then ShowMessage(c.ErrorMessage); end;
var c = new ActiveXObject("ExcelConverter.ExcelConverterX"); c.Convert("C:\\test\\source.xlsx", "C:\\test\\dest.pdf", "-c PDF"); if (c.ErrorMessage!="") alert(c.ErrorMessage)
use Win32::OLE; my $src="C:\\test\\test.XLS"; my $dest="C:\\test\\test.CSV"; my $c = CreateObject Win32::OLE 'ExcelConverter.ExcelConverterX'; $c->convert($src,$dest, "-c csv -log c:\\test\\xls.log"); print $c->ErrorMessage if -e $dest;
© 2024. 版权所有. CoolUtils File Converters