Commit b1679824 authored by Stephan Kreutzer's avatar Stephan Kreutzer

wakelet_to_pdf_1: Generate PDF (pdflatex backend).

parent 5f50b2a5
......@@ -14,3 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
java xhtml_to_latex_1 ./wake/ ./output_print/
#cd ./output_print/
#for inputfile in *.tex; do pdflatex -interaction=nonstopmode $inputfile; done
#cd ..
......@@ -411,6 +411,8 @@ public class xhtml_to_latex_1
System.exit(-1);
}
List<File> latexFileList = new ArrayList<File>();
for (int i = 0; i < sourceList.size(); i++)
{
File preparedFile = new File(tempDirectory.getAbsolutePath() + File.separator + "xhtml_prepared-" + (i + 1) + ".xhtml");
......@@ -470,6 +472,8 @@ public class xhtml_to_latex_1
}
}
latexFileList.add(latexFile);
/** @todo This would be much smarter if the preparations can be completed in advance,and
* and then doing the transformations in one go with one jobfile containing several jobs. */
StringBuilder xmlXsltTransformator1JobfileContentStringBuilder = new StringBuilder();
......@@ -484,6 +488,34 @@ public class xhtml_to_latex_1
callCapability(xmlXsltTransformator1Jobfile, xmlXsltTransformator1JobfileContentStringBuilder.toString(), "xml_xslt_transformator_1", xmlXsltTransformator1Path, xmlXsltTransformator1ResultInfoFile);
}
for (int i = 0; i < latexFileList.size(); i++)
{
for (int j = 0; j < 4; j++)
{
ProcessBuilder builder = new ProcessBuilder("pdflatex", "-interaction=nonstopmode", latexFileList.get(i).getAbsolutePath());
builder.directory(latexFileList.get(i).getParentFile());
builder.redirectErrorStream(true);
try
{
Process process = builder.start();
Scanner scanner = new Scanner(process.getInputStream()).useDelimiter("\n");
while (scanner.hasNext() == true)
{
System.out.println(scanner.next());
}
scanner.close();
}
catch (IOException ex)
{
System.out.println("xhtml_to_latex_1: An error occurred while reading pdflatex output.");
System.exit(1);
}
}
}
return 0;
}
......
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