Is it possible to convert a tex/latex file into pdf in a C# Windows Form Application with an embedded translator?
I would like to be able to create pdf file from (la)tex file even when pdflatex is not installed on the computer.
Currently, I use MigraDoc for creating pdf files, but I consider latex more powerful.
You can use Pandoc
as an external program in your windows app. Please ref to http://pandoc.org/index.html
. This is a tool for converting text file, like Markdown to Http.
You can do this by using Aspose.Pdf nuget package. Here is the code to do so:
string dataDir = @"PATH TO LATEX FILE";
LatexLoadOptions Latexoptions = new LatexLoadOptions();
Document doc = new Document(dataDir + "sample.tex", Latexoptions);
doc.Save(dataDir + "TeXToPDF_out.pdf");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.