def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
use_pdftocairo, conv, gs_device, gs_ext, alpha, resolution, output_format):
+ error_count = 0
+
# Search for pdflatex executable
pdflatex = find_exe(["pdflatex"])
if pdflatex == None:
warning("Can't find pdflatex. Some pages failed with all the possible routes.")
+ failed_pages = []
else:
# Create a new LaTeX file from the original but only with failed pages
pdf_latex_file = latex_file_re.sub("_pdflatex.tex", latex_file)
if conv_status:
# Give up!
warning("Some pages failed with all the possible routes")
+ failed_pages = []
else:
# We've done it!
pdf_log_file = latex_file_re.sub(".log", pdf_latex_file)
for index in error_pages:
pdf_metrics.pop(index - 1)
pdf_metrics.insert(index - 1, (index, -1.0))
+ error_count += 1
original_bitmap = latex_file_re.sub("%d." + output_format, pdf_latex_file)
destination_bitmap = latex_file_re.sub("%d." + output_format, latex_file)
join_metrics_and_rename(legacy_metrics, pdf_metrics, failed_pages,
original_bitmap, destination_bitmap)
+ return error_count
+
# The file has been processed through latex and we expect dvi output.
# Run dvips, taking note whether it was successful.