Commit e10405f8 authored by Syretta Man's avatar Syretta Man

modified pdf 2

parent 9249d06c
Pipeline #112960 passed with stages
in 49 seconds
......@@ -96,12 +96,12 @@ public class WebServer {
resp.setContentType("application/pdf");
resp.setHeader("Content-disposition", "attachment; filename=sample.pdf");
ProcessBuilder pb = new ProcessBuilder();
String[] cm = {"pandoc", "-s", "-o", "sample.pdf", "answer.md"};
pb.command(cm);
ProcessBuilder pb = new ProcessBuilder("pandoc answer.md -f markdown -o test.pdf");
// String[] cm = {"pandoc", "-s", "-o", "sample.pdf", "answer.md"};
// pb.command(cm);
pb.start();
try (InputStream in = new FileInputStream(file);
try (InputStream in = new FileInputStream("test.pdf");
OutputStream out = resp.getOutputStream()) {
byte[] buffer = new byte[1048];
......
......@@ -50,4 +50,9 @@ public class QueryProcessorTest {
public void isNotCaseSensitive2() throws Exception {
assertThat(queryProcessor.process("DANQINGHU"), containsString("Planet Coaster"));
}
@Test
public void download() throws Exception {
assertThat(queryProcessor.process("DANQINGHU"), containsString("Planet Coaster"));
}
}
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