Path: csiph.com!xmission!news.alt.net!not-for-mail From: owl Newsgroups: comp.os.linux.advocacy Subject: Re: Three more weeks of UNIX Date: Sat, 5 Sep 2015 19:10:02 +0000 (UTC) Organization: ok by me, so long as it doesn't get out of hand Lines: 83 Message-ID: References: <390avmv9.jiida@rooftop.invalid> <20150905195835.195fdc44@maxa-pc> NNTP-Posting-Host: boom.rooftop.invalid Xref: csiph.com comp.os.linux.advocacy:319154 Melzzzzz wrote: > On Sat, 5 Sep 2015 16:59:50 +0000 (UTC) > owl wrote: >> Snit wrote: >> > On 9/4/15, 12:39 AM, in article fad.viz0@rooftop.invalid, "owl" >> > wrote: >> >> > ... >> >>> I am responsible only for my actions, and my actions are honest. >> >>> If you wish to believe my weird "fan" club about my "unquotable >> >>> lies" then so be it. >> >> >> >>> And you have still not shared your script. Why not? >> >> >> >> I may post it tomorrow. I need to try a few things first. >> >> > You are spending a LOT more time on yours than I did mine... >> >> Because there's apparently a bug in wkhtmltopdf. (Huge file sizes). >> >> > but yours will >> > likely also be a lot "cleaner". Mine is a bit of a mess, but as we >> > saw it works well. >> >> > Once you share yours I will make my video public: >> > >> >> > Looking at my script again I could have made it a LOT easier. Might >> > test that tomorrow and then have a MUCH better script. But >> > whatever... it works. :) >> >> The code should work on OS X with the zenity stuff commented out. >> Curious if the wkhtmltopdf bug is still present in the OS X >> version. At the time it was mentioned, the thing apparently >> worked fine for Linux. Now I'm seeing what appears to be >> that same situation that was described for the OS X version, >> but on Linux. > Have you tried with --lowquality option? >> >> #!/bin/sh >> >> date=`date` >> #zenity --notification --text="starting... ${date}" >> stime=`date +%s` >> >> if [ ! -e ~/Recipes ];then >> mkdir ~/Recipes >> fi >> >> html="$(parallel --no-notice -P 3 -N 3 wget -q {1} {2} {3} ::: \ >> allrecipes.com -O - \ >> allrecipes.com/?page=2 -O - \ >> allrecipes.com/?page=3 -O -)" >> >> recipelines=$( echo "${html}" |grep /recipe/ \ >> |perl -e 'while(<>){ $x=$_;$x=~s/^.*> $x=~s/\".*//g;print $x;}' \ |uniq) >> >> filenames=$(echo "${recipelines}" |cut -f4 -d'/') >> >> parallel --no-notice -P 8 -N 1 --xapply \ > you should do all at once to hide download latencies.... Tried it several ways. Downloading all at once, then running wkthtmltopdf against local files, etc. The big factor is the processing html to pdf, even parallelized on local files. Since download time was very small, I thought to pull the html into variables and avoid tmpfile creation. >> wkhtmltopdf -q -n \ >> http://allrecipes.com/{1}/print/ /home/anon/Recipes/{2}.pdf \ >> ::: ${recipelines} ::: ${filenames} > try --lowquality option. Been there done that. Doesn't help. It's how wkhtmltopdf is dealing with fonts. I posted a link the other day about this same effect (huge PDF file sizes) using wkhtmltopdf on OS X. I think it's somewhere in this thread.