javascript - Is it possible to load large PDF containing image faster?
Get the solution ↓↓↓Part of application I've created shows informations about scanned product, part of which is its label that i need to load from another server which works as storage. But their size is inconsistient (I sadly can't change it) ranging from half a MB to 20MB or more. And here is my problem the end-user can only see the info for max 9s and for bigger pdf's the loading takes most of this time.
The File on that page is loaded like that
document.querySelector('#etykieta').innerHTML = `<embed type='application/pdf' src=\"http://${pdfServerIP}/pdf/?path=${etkPath}&file=${etykieta}\">`;
And on the server that holds PDF's it looks like that (I couldn't make it load the pdf directly from shared directory on synology cloud so I ended with this workaround)
if ($handle = opendir($pth)) {
while (false !== ($file = readdir($handle))) {
$pl = substr($file, 0, $dl);
if ($pl == $plik) {
$jest++;
echo "{$file}<BR>";
header("Content-type:application/pdf");
readfile("{$pth}{$file}");
exit;
}
}
closedir($handle);
}
So is there any way to make the PDF's load faster without editing the files?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: object not found by the @paramconverter annotation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.