Discussion (10)6
Log in or sign up to continue

I have been working on this recently and tried the links in this and other questions, but in the end settled for using Chrome.  It was easier, quicker and less moving parts as Chrome was already on the servers. 

/// "C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --print-to-pdf="E:\Data\Spooler\2022-07\DN560241_14a.pdf" "E:\Data\Spooler\2022-07\DN560241_14.htm"

strExePath=..getChrome()  // This function just handles the fact some machines put chrome in program files, others in program files (x86)
s1=$ZF(-100,"/LOGCMD /NOQUOTE /STDOUT+=e:\logs\H2POUT.log /STDERR+=e:\logs\H2Perr.log",strExePath,"--headless --disable-gpu --print-to-pdf-no-header --print-to-pdf="""_strPDFPath_""" """_strHTMLPath_"""") // For some weird reason this flags as an error when it completes, no idea why, but its not valid.
//w "S1: "_s1,!!
//I $$$ISERR(s1) Q $SYSTEM.Status.GetErrorText(s1)
##class(%File).Exists(strPDFPath)
"1*"_strPDFPath 
ELSE 
"0*Error Occurred" }