文檔首頁(yè)>>Aspose.PDF使用教程>>Aspose.Pdf使用教程:將PDF文件轉(zhuǎn)換成TeX格式
Aspose.Pdf使用教程:將PDF文件轉(zhuǎn)換成TeX格式
LaTeX文件格式是一種文本文件格式的文件,標(biāo)記在TeX語言的LaTeX 2ε衍生語言中,LaTeX是TeX系統(tǒng)的派生格式。
為了實(shí)現(xiàn)這個(gè)功能,Aspose.Pdf推出了一個(gè)名為L(zhǎng)aTeXSaveOptions的類,其中的OutDirectoryPath屬性用于在轉(zhuǎn)換過程中保存臨時(shí)圖片。
下面是將PDF文件轉(zhuǎn)換為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)