1

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:

sCmd = {C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe  c:\TempPDF\22D6\temp.html c:\TempPDF\22D6\PPE00003.pdf}
taskId = Shellid(sCmd)

On Linux:

sCmd = {/usr/local/bin/wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf}
taskId = Shellid(sCmd)

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).

UPDATE: @TorstenLink Seems this is a issue with wkhtmltopdf, when called by a scripting service - php or Ruby (see also: link. It will NOT load local files.

For interest Running as Agent script the logs show:

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

r

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.

So now I am putting the html files into the local (domino) http server and reading them from there (so my source will be http://127.0.0.1/PDFTemp/3496/temp.html)!! Not the nicest of solutions but works.

  • did you test it with the same user as the domino server ? – umeli Feb 12 '19 at 11:38
  • Hi umeli, I have asked the Linux admins to confirm. Am I OK to infer that the Linux Shell command looks good to you, should we be "sh /usr/local/bin/wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf" – Brian Sherwood Feb 12 '19 at 13:11
  • 1
    The shell command is correct. This shell will be executed with the user the Domino ist started with (usually "notes" if not changed). Does the user "notes" have rights to /DATA/temp and to execute the wkhtmltopdf executable (x- flag set for user "notes")? – Tode Feb 12 '19 at 15:09
  • Thanks - so I have confirmation: Yes the "notes" user has access to /DATA/temp. It also has access to execute wkhtmltopdf. We ran the command "/usr/local/bin/wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf" and it completes successfully and generates the PDF Using the "notes" user account. – Brian Sherwood Feb 13 '19 at 10:13
  • We have even tried moving the wkhtmltopdf into the server executables, so we can on the console run : wkhtmltopdf /DATA/temp/22D6/temp.html /DATA/temp/22D6/PPE00003.pdf . This works if we type into the console (PDF File is created), but if we do a Lotusscript session.Sendconsolecommand("", sCmd) it fails.. Seriously, What? No errors, just no PDF. – Brian Sherwood Feb 19 '19 at 10:49

0 Answers0