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

View File

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