logo Aspose.PDF使用教程 我也要发布文档

将PDF文件转换成TeX格式


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

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

》》》免费下载Aspose.Pdf试用版

下面是将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)