2

There is RunThrough which captures the output and evaluates it. However, I would like the output as String. Is there a direct way without redirecting to temporary files etc.? Here is the code:

pdftohtml = "pdftohtml.exe";
pdf = "test.pdf";
ans = RunThrough[pdftohtml <> " -stdout " <> pdf, ""];

This fails with the error message

Syntax::sntx: Invalid syntax in or before 
"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">".

Is there a way to get to the output without evaluating it?

Karsten W.
  • 1,383
  • 8
  • 21

1 Answers1

3
StringJoin@ReadList["!"<>pdftohtml <> " -stdout " <> pdf, Character]

Or

RunProcess[{pdftohtml," -stdout ",pdf}, "StandardOutput"]
yohbs
  • 7,046
  • 3
  • 29
  • 60