{"id":460,"date":"2004-08-07T13:41:40","date_gmt":"2004-08-07T11:41:40","guid":{"rendered":"http:\/\/vasil.ludost.net\/blog\/?p=460"},"modified":"2004-08-07T13:41:40","modified_gmt":"2004-08-07T11:41:40","slug":"2004-08-07-1341","status":"publish","type":"post","link":"https:\/\/vasil.ludost.net\/blog\/?p=460","title":{"rendered":"2004-08-07 13:41"},"content":{"rendered":"<p>I felt too lazy last night to blog&#8230;<\/p>\n<p>Yesterday through the day I had a funny task &#8211; a script to convert html to tiff, which was needed by a friend. It turned out to be really interesting, especially because it needed to have working cyrillic :) Because someone else might need it, here it is:<\/p>\n<pre>\r\n#!\/bin\/sh\r\n\r\n# by <vasil (at)ludost(dot)net>\r\n\r\n#requirements in debian packages:\r\n# apt-get install htmldoc xpdf-reader imagemagick gs-common  libtiff-tools\r\n\r\nif [ -z \"$2\" ]; then\r\n        echo Usage: $0 input-file output-file-prefix\r\n        exit 2\r\nfi\r\n\r\nk=`tempfile`\r\nrm -f $k && mkdir $k || exit 8\r\nhtmldoc --webpage --continuous $1 -t ps --charset cp-1251 -f $k\/OUTPUT.ps\r\ncdr=`pwd`\r\ncd $k || exit 4\r\nps2pdf OUTPUT.ps\r\npdftoppm OUTPUT.pdf output\r\nconvert output*ppm  $cdr\/$2.tiff\r\ncd $cdr || exit 5\r\nrm -rf -- $k\r\n<\/vasil><\/pre>\n<p>It could probably be written better, especially the thing with that temporary directory, but it&#8217;s just a proof-of-concept. The conversion fom postscript to PDF is needed, because htmldoc has a bug in the pdf files generation, and convert doesn&#8217;t handle pdf well, and I have to go through ppm. It was a lot of tweaking, until it worked.<\/p>\n<p>Nothing else interesting, except going again at the square to listen to the concerts, and reading Quicksilver. This time they played concert for piano and orchestra number I-can&#8217;t-remember-which by Tchaykovski, it was great (on the piano there was Evgeny Kissin, who then has been 15 years old &#8230;:) )<\/p>\n<p>I&#8217;m having weird dreams, with some known female friends, really weird, second night in a row&#8230; Looks like Velin has such too, and I think that probably the apartment is cursed&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I felt too lazy last night to blog&#8230; Yesterday through the day I had a funny task &#8211; a script to convert html to tiff, which was needed by a friend. It turned out to be really interesting, especially because it needed to have working cyrillic :) Because someone else might need it, here it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-460","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=460"}],"version-history":[{"count":0,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/460\/revisions"}],"wp:attachment":[{"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vasil.ludost.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}