Commit a0680e4c authored by tianyi's avatar tianyi
Browse files

Testing on server... printing extra info

parent 2378292c
Pipeline #63623 failed with stages
in 10 minutes and 39 seconds
......@@ -21,12 +21,19 @@ public class PdfCreator implements Page {
OutputStream writer = resp.getOutputStream();
File markdown = toMarkDown(answer, query);
// turn markdown to a pdf using pandoc
ProcessBuilder pb = new ProcessBuilder("pandoc",markdown.getName() , "-o", "temp.pdf");
ProcessBuilder pb = new ProcessBuilder("pandoc",markdown.getName() , "-o",query + ".pdf");
File dir = new File("/tmp");
pb.directory(dir);
System.out.println("The new pdf will have name of "+query + ".pdf");
Process process = pb.start();
process.waitFor();
File pdf = new File("/tmp/temp.pdf");
System.out.println("=================================================");
String[] strs = dir.list();
for(String str: strs){
System.out.println(str);
}
System.out.println("=================================================");
File pdf = new File("/tmp/"+query+".pdf");
writer.write(new FileInputStream(pdf).readAllBytes());
writer.close();
markdown.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