Aspose.Pdf使用教程:将PDF文件转换成TeX格式

Aspose.PDF 是一款高级PDF处理API,可以在跨平台应用程序中轻松生成,修改,转换,呈现,保护和打印文档。无需使用Adobe Acrobat。此外,API提供压缩选项,表创建和处理,图形和图像功能,广泛的超链接功能,图章和水印任务,扩展的安全控件和自定义字体处理。。本文将为你介绍如何在 C++ 中将PDF转换为Doc 、Docx 。

Aspose API支持流行文件格式处理,并允许将各类文档导出或转换为固定布局文件格式和最常用的图像/多媒体格式。 

LaTeX文件格式是一种文本文件格式的文件,标记在TeX语言的LaTeX 2ε衍生语言中,LaTeX是TeX系统的派生格式。

为了实现这个功能,Aspose.Pdf推出了一个名为LaTeXSaveOptions的类,其中的OutDirectoryPath属性用于在转换过程中保存临时图片。

下面是将PDF文件转换为TeX格式的代码片段

C#

// create Document object
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(@"d:\pdftest\Input.pdf");
// instantiate LaTex save option            
LaTeXSaveOptions saveOptions = new LaTeXSaveOptions();
// specify the output directory 
string pathToOutputDirectory = @"d:\pdftest\";
// set the output directory path for save option object
saveOptions.OutDirectoryPath = pathToOutputDirectory;
// specify output file name                  
string outFileName = pathToOutputDirectory + "Output.tex";
// save PDF file into LaTex format            
doc.Save(outFileName, saveOptions);

VB.NET

' create Document object
Dim doc As Aspose.Pdf.Document = New Aspose.Pdf.Document("d:\pdftest\Input.pdf")
' instantiate LaTex save option            
Dim saveOptions As LaTeXSaveOptions = New LaTeXSaveOptions()
' specify the output directory 
Dim pathToOutputDirectory As String = "d:\pdftest\"
' set the output directory path for save option object
saveOptions.OutDirectoryPath = pathToOutputDirectory
' specify output file name                  
Dim outFileName As String = pathToOutputDirectory + "Output.tex"
' save PDF file into LaTex format            
doc.Save(outFileName, saveOptions)

猜你喜欢

转载自blog.csdn.net/m0_67129275/article/details/131549405