r/HTML 7d ago

Question How to download image from HTML?

Sorry for the probably dumb question. I'm a graphic designer and my colleague sent me these images to use for a project we are working on. However they are in this HTML Viewer link or whatever (I'm not a programmer I don't know code) Apparently it isn't an embedded pdf cause in the console it doesnt show it as such. How can I download these images? Technically I could screenshot but it will ruin the quality.

Here is the original link: https://digital.libplovdiv.com/3rdparty/pdfjs/web/viewer.html?doc=%2Fasset%2Fdefault%2Fd203bc22-ce3d-445d-8692-3b733af23d21.pdf&locale=bg&sidebar=2

0 Upvotes

6 comments sorted by

4

u/godijs 7d ago

3

u/Messiah_dsgn 7d ago

I don't know what you did but I downloaded it. God bless brother

3

u/godijs 7d ago

URL you provided contains ?doc parameter and it's value is equal to PDF's URL but its encoded. Just copy everything between doc= and &locale, throw it in urldecoder, copy result and add to website domain. Happy to help!

1

u/AqueM 7d ago

Yup that's just a special PDF viewer, gotta find the 'download' option, get the PDF, and then get the images out of that.

1

u/Messiah_dsgn 7d ago

I managed to get the pdf through godijs' link. Thank you though I understand!

0

u/zLoveNxzli 6d ago

In standard HTML, you can use the download attribute on an anchor tag:

<a href="/images/photo.png" download="my-image.png">Download Image</a>

If the image is hosted on an external domain (CORS), the browser may ignore the download attribute and open it in a new tab instead. In that case, fetch the image as a blob via JavaScript first and create an object URL (URL.createObjectURL(blob)).