Advertisement
MrChrHD

QPDF Decrypt Process call

Jan 19th, 2023 (edited)
1,118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | Source Code | 0 0
  1. // Run QPDF to decrypt the input file
  2. private bool decrypt()
  3. {
  4.     // Create new process
  5.     Process decryptProcess = new();
  6.     decryptProcess.StartInfo.UseShellExecute = false;
  7.     decryptProcess.StartInfo.CreateNoWindow = true;
  8.  
  9.     // Parameters
  10.     decryptProcess.StartInfo.FileName = "QPDF\\qpdf.exe";
  11.     decryptProcess.StartInfo.Arguments = "--decrypt --password=" + password + " \"" + inputFilePath + "\" \"" + outputFilePath + "\"";
  12.  
  13.     // Start Process
  14.     decryptProcess.Start();
  15.  
  16.     // Wait for process to complete
  17.     decryptProcess.WaitForExit();
  18.  
  19.     // Check for sucessful completion
  20.     return (decryptProcess.ExitCode == 0);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement