在Powershell中使用wkhtmltopdf,PDF文件将按预期打印,但它会抛出如下警告:
& "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --print-media-type -q --header-left [webpage] --header-font-size 7 --footer-left [isodate] $listing.Url $pdfDest
wkhtmltopdf.exe : libpng warning: iCCP: known incorrect sRGB profile
At R:\powershell_scripts\aso\get_individual_aircraft.ps1:138 char:13
+ & "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --pr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (libpng warning:...ct sRGB profile:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError我想要么处理这个警告,要么因为pdf的工作令人满意,我想压制警告。请告诉我方向。
发布于 2017-01-09 07:03:28
从错误中可以看出,该命令引用的是第138行的get_individual_aircraft.ps1。
你能不能把
$ErrorActionPreference =‘沉默连续’;
在那个剧本里,看看它是否有效。我相信EXE会在这个脚本的帮助下被调用。
https://stackoverflow.com/questions/41538154
复制相似问题