0
qpdf可以将pdf转换为线性化pdf(网页快速查看属性)。我可以使用命令行: qpdf --linearize input.pdf output.pdf将pdf转换为线性化的pdf。如何在asp.net应用程序中使用qpdf
我怎么能在asp.net程序上使用它?
我的代码就是这样
private void LaunchCommandLineApp()
{
// For the example
string ex4 = @"C:\Program Files\qpdf-7.0.b1\bin\qpdf.exe";
// Use ProcessStartInfo class
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = ex4;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = " --linearize input.pdf output.pdf";
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
if (exeProcess != null)
{
string op = exeProcess.StandardOutput.ReadToEnd();
exeProcess.WaitForExit();
Console.WriteLine(op);
}
}
}
catch (Exception ex)
{
// Log error.
}
}
是否有任何其他的解决方案在asp.net使用Qpdf?非常感谢!