Closed kpu closed 4 years ago
Note that pdftohtml - foo.html
also works and might be more cross-platform.
Actually, you can do both stdin and stdout like so, but it requires a filename it won't use for. . . reasons.
pdftohtml -s -i -noframes -xml -stdout -fontfullname - nonsense <a.pdf
Hi @kpu
Thank & Regard Romuelee
You need to copy bytes from the user's ByteArrayInputStream
to the subprocesses's getOutputStream()
. getOutputStream()
returns OutputStream
which has a write
method that accepts bytes.
You'll probably want a thread for it.
The commit that fixed this issue (https://github.com/bitextor/pdf-extract/commit/6182d33afc2f56f3a2d7a5639712e1e9f54a96f0) introduced this other issue: https://github.com/bitextor/pdf-extract/issues/56
I just tested
and
and got identical results.
So all the temporary file stuff is inefficient and unnecessary.
https://github.com/bitextor/pdf-extract/blob/4ad28a23817851355ba65b6b4699a8f01b2cb760/src/pdfextract/PDFToHtml.java#L43
As an aside, I'm not sure why you made a random string for
createTempFile
in the file suffix. It does the random string part for you.