Commit ce738bc0 authored by Syretta Man's avatar Syretta Man

modified pdf 3

parent e10405f8
Pipeline #112969 passed with stages
in 47 seconds
......@@ -94,14 +94,14 @@ public class WebServer {
bw.close();
resp.setContentType("application/pdf");
resp.setHeader("Content-disposition", "attachment; filename=sample.pdf");
resp.setHeader("Content-disposition", "attachment; filename=haha.pdf");
ProcessBuilder pb = new ProcessBuilder("pandoc answer.md -f markdown -o test.pdf");
ProcessBuilder pb = new ProcessBuilder("bash -c", "pandoc answer.md -f markdown -o answer.pdf");
// String[] cm = {"pandoc", "-s", "-o", "sample.pdf", "answer.md"};
// pb.command(cm);
pb.start();
try (InputStream in = new FileInputStream("test.pdf");
try (InputStream in = new FileInputStream("answer.pdf");
OutputStream out = resp.getOutputStream()) {
byte[] buffer = new byte[1048];
......@@ -111,6 +111,7 @@ public class WebServer {
out.write(buffer, 0, numBytesRead);
}
}
file.delete();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment