首页 > 解决方案 > 如何防止 LaTex 代码编译后弹出 pdf 文件?

问题描述

我正在使用 C# 制作一个 WinForm 应用程序,我将在其中编译一些 LaTex 代码并获取生成的 PDF 文件,然后将 PDF 文件转换为图像。但是每次我点击按钮,PDF文件都会弹出来,这很烦人!以下是我与该按钮相关的代码。

private void Button1_Click(object sender, EventArgs e)
    {                              
            p1 = new Process();
            p1.StartInfo.FileName = "F:\\texlive\\2018\\bin\\win32\\pdflatex";                
            p1.StartInfo.Arguments = "input.tex";// input.tex is the latex file I prepared
            p1.StartInfo.UseShellExecute = false;
            p1.StartInfo.CreateNoWindow = true;               
            p1.StartInfo.RedirectStandardOutput = true;
            p1.StartInfo.RedirectStandardError = true; 
            p1.StartInfo.RedirectStandardInput = true;
            p1.Start();
           // richTextBox2.Text = p1.StandardOutput.ReadToEnd();   
            pdfWrapper.LoadPDF("output.pdf"); // use PdfLiNnet to convert the output pdf file to jpg
            pdfWrapper.ExportJpg("output.jpg",1,1,  Dpi, Qua);                             
            p1.WaitForExit();               
            p1.Close();
        }

有谁知道在编译 LaTex 代码后如何防止或隐藏 pdf 文件的弹出窗口?提前致谢。

标签: c#winformslatex

解决方案


推荐阅读