bmv
bmv

Reputation: 204

Convert LaTeX file to Pdf in C# Windows Form Application

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.

Upvotes: 1

Views: 1102

Answers (2)

Hassan Iftikhar
Hassan Iftikhar

Reputation: 149

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");

Upvotes: 0

Yang Yu
Yang Yu

Reputation: 312

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.

Upvotes: 1

Related Questions