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

(cherry picked from commit df84352385)
This commit is contained in:
Mario Vavti 2018-12-01 20:37:33 +00:00 committed by Mario
parent 05c422ef23
commit defa2d9df1

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'
];
} }