make pdf preview 100% width and 300px height to match it openstreetmaps preview

This commit is contained in:
Mario Vavti 2018-12-01 21:37:33 +01:00
parent cded6b1136
commit df84352385

View File

@ -221,7 +221,11 @@ function oembed_fetch_url($embedurl){
if(strpos(strtolower($embedurl),'.pdf') !== false) { if(strpos(strtolower($embedurl),'.pdf') !== false) {
$action = 'allow'; $action = 'allow';
$j = [ 'html' => '<object data="' . $embedurl . '" type="application/pdf" width="500" height="720">' . '<a href="' . $embedurl . '">' . t('View PDF') . '</a></object>', 'width' => 500, 'height' => 720, 'type' => 'pdf' ]; $j = [
'html' => '<object data="' . $embedurl . '" type="application/pdf" style="width: 100%; height: 300px;"></object>',
'title' => t('View PDF'),
'type' => 'pdf'
];
} }