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