1
我使用DOMPDF创建了一个pdf,它在本地和服务器上使用HTTP工作正常,但是当源位于服务器中时,HTTPS不显示图像。图像不与DOMPDF一起用HTTPS显示
$options->set('isRemoteEnabled', TRUE);
$dompdf = new Dompdf($options);
$context = stream_context_create([
'ssl' => [
'verify_peer' => FALSE,
'verify_peer_name' => FALSE,
'allow_self_signed'=> TRUE
]
]);
$dompdf->setHttpContext($context);
也许(?????)http://stackoverflow.com/a/22911050/797620 – Abela
可能不是DOMpdf问题。尝试使用相同的流上下文读取远程Web $ fp = fopen($ yourUrl,'r',false,$ context);或$ response = file_get_contents($ yourUrl,0,$ context); – Curlas
不,我很抱歉,dom pdf不接受http格式的网址。 – Curlas