add nonstopmode

This commit is contained in:
Семенова Мария 2019-04-03 17:46:45 +04:00
parent 0c34571354
commit ded0ab482a
2 changed files with 6 additions and 9 deletions

View File

@ -40,12 +40,9 @@ public class LatexService {
Process process = processBuilder.start();
InputStreamReader inputStreamReader = new InputStreamReader(process.getInputStream());
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
try {
try (BufferedReader bufferedReader = new BufferedReader(inputStreamReader)) {
while ((bufferedReader.readLine()) != null) ;
} finally {
bufferedReader.close();
}
int exitCode = process.waitFor();
@ -56,9 +53,10 @@ public class LatexService {
}
private boolean generate(String filename, File dir) throws IOException, InterruptedException {
if (startProcess(new String[]{"pdflatex", filename}, dir, pdfLatexError) != 0) return false;
startProcess(new String[]{"bibtex", filename}, dir, bibtexError);
if (startProcess(new String[]{"pdflatex", filename}, dir, pdfLatexError) != 0) return false;
startProcess(new String[]{"pdflatex", filename, "--interaction=nonstopmode"}, dir, pdfLatexError);
startProcess(new String[]{"bibtex", filename, "--interaction=nonstopmode"}, dir, bibtexError);
if (startProcess(new String[]{"pdflatex", filename, "--interaction=nonstopmode"}, dir, pdfLatexError) != 0)
return false;
return checkPdf(filename, dir);
}

View File

@ -339,7 +339,6 @@
function generatePDF() {
$('#pdfLoadingIcon').show();
$('#pdfBtn').prop('disabled', true);
;
var formData = new FormData(document.forms.paperform);
var xhr = new XMLHttpRequest();
@ -360,10 +359,10 @@
a.click();
window.URL.revokeObjectURL(url);
} else {
showFeedbackMessage("Ошибка при создании PDF");
}
$('#pdfLoadingIcon').hide();
$('#pdfBtn').prop('disabled', false);
;
}
}