The script just bundles all the text; I wrote it that way on purpose, so you could use whichever PDF converter you wanted to.
I noticed this and I like that you've bundled all the text. This eliminates the need to piece together the script manually. From a pedagogic perspective it may detract a little but I don't want to split hairs.
However, I don't see how a reader couldn't follow the original post and not simply swap occurrences of "
unoconv" with "
text2pdf". You see what I mean? I other words, there was never a dependency on "
unoconv" specifically AFAICT.
Well, okay again, I may be approaching this from an instructional point of view as some small changes would be needed since I don't think "
text2pdf" takes input from a file via argument. Again, I want to avoid splitting hairs.
If the one you're using doesn't like STDIN, well - there's no exact equivalent to 'mktemp(3)' in the shell (auto-delete on exit), but this should do the job:
Code:
(trap 'rm -f $X' EXIT; X=$(mktemp); pdfgen demo.py>$X; pdfWhatever $X>demo.pdf)
Yeah, this is basically what I needed to do in order to use "
unoconv". Which is, by all accounts, "
unoconvs" fault... I think. But, as Steven Wright once noted so acutely, "
you can't have everything, where would you put it?"
I think, in reality, if one wants to use
unoconv vs
text2pdf some small differences may be desired in the whole integration just for the sake of convenience. Or your
mktemp suggestion could be put in a higher level script. But, at some point trying to cover all the bases does start to get exceptionally, uh... messy (imho)? For lack of a better word.
If only the
unoconv people could co-operate with the
txt2pdf people and iron out each other's issues ;-)