title: IBM Domino calling wkhtmltopdf by shell on Linux
body: <p>We have this running well on a IBM Domino 9.0.1 Windows server, but when moved to Linux (Domino 9.0.1, on Linux 4.15.0-43-generic #46-Ubuntu SMP Th) the process fails. We convert html files to PDF to send to users.
  Windows, in short, works by calling:</p>
  
  <pre><code>sCmd = {C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe  c:\TempPDF\22D6\temp.html c:\TempPDF\22D6\PPE00003.pdf}
  taskId = Shellid(sCmd)
  </code></pre>
  
  <p>On Linux:</p>
  
  <pre><code>sCmd = {/usr/local/bin/wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf}
  taskId = Shellid(sCmd)
  </code></pre>
  
  <p>We have verified wkhtmltopdf works; running /usr/local/bin/wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf on Linux box works, just does not work when called from the Notes Lotusscript agent (by ShellID).</p>
  
  <p>UPDATE: @TorstenLink Seems this is a issue with wkhtmltopdf, when called by a scripting service - php or Ruby (see also: <a href="https://stackoverflow.com/questions/14431391/wkhtmltopdf-attempting-to-load-from-http-rather-than-file">link</a>.  It will NOT load local files.</p>
  
  <p>For interest
  Running as Agent script the logs show:</p>
  
  <pre><code>AMgr: Agent ('email PDF' in 'fastworks/Live/PDFPrint.nsf') printing: CMD:/usr/local/bin/wkhtmltopdf --header-left "Printed by LinuxDev [date] [time]"  --header-right "Page [page] of [toPage]"  "file:///home/notes/Documents/PDFTemp/3496/temp.html" /home/notes/Documents/PDFTemp/3496/LONACC00013.pdf
  Loading pages (1/6)
  Error: Failed to load http:/, with network status code 3 and http status code 0 - Host  not found
  Error: Failed loading page http: (sometimes it will work just to ignore this error with --load-error-handling ignore)
  Error: Failed to load http://by/, with network status code 3 and http status code 0 - Host by not found
  Error: Failed loading page http://by (sometimes it will work just to ignore this error with --load-error-handling ignore)
  Error: Failed to load http://of/, with network status code 3 and http status code 0 - Host of not found
  Error: Failed loading page http://of (sometimes it will work just to ignore this error with --load-error-handling ignore)
  Error: Failed to load http://linuxdev/, with network status code 3 and http status code 0 - Host linuxdev not found
  Error: Failed loading page http://linuxdev (sometimes it will work just to ignore this error with --load-error-handling ignore)
  Error: Failed to load http://home/notes/Documents/PDFTemp/3496/temp.html", with network status code 3 and http status code 0 - Host home not found
  Error: Failed loading page http:///home/notes/Documents/PDFTemp/3496/temp.html" (sometimes it will work just to ignore this error with --load-error-handling ignore)
  Exit with code 1 due to network error: HostNotFoundErro
  </code></pre>
  
  <p>r</p>
  
  <p>but if run the same command in a Terminal Window it works (logged in as notes).  Cannot understand how the code knows to change what it looks for.  </p>
  
  <p>So now I am putting the html files into the local (domino) http server and reading them from there (so my source will be <a href="http://127.0.0.1/PDFTemp/3496/temp.html" rel="nofollow noreferrer">http://127.0.0.1/PDFTemp/3496/temp.html</a>)!!  Not the nicest of solutions but works.</p>