How to load images from server in PDF file? - image

I have to create PDF file with images in external location. I have 137 jpg files and each file is one page, so 1.jpg is 1st page, 2.jpg is 2nd page etc. I need to load this images from my server and if I edit any image, this change will be avaiable in this PDF file because images are loaded from my server. I searched for any solution for that but I couldn't find any correct answer. There is any way to do that?

Related

Is there a fast way of gathering image files from external sources (Chrome Developer Tab)

Let's say I visit a website named abc.xyz.
When I get to the website, I see the website runs a javascript script to create an interactive book. Obviously, the book must have image files for each page.
Now let's say I go to the developer tools tab and go to the sources tab to find the images - sure enough, I find them. However, the images come from a folder and domain named xyz.abc that displays a 403 error when accessed.
Is there a faster way of gathering these image files than visiting the links for every single image and individually saving every single image (Bare in mind the images themselves are not restricted access)?
Real World Example:
Image showing files under the sources tab.
In the image above, you can see there are several image files located in a folder (hundreds, in fact). The domain and folder the images reside in display 403 errors when accessed, however the images themselves are not restricted. To download the images, you can individually get the link to each image and use "Save image as". However, this will be time-consuming for hundreds of images - is there a faster way to download all the images?
Edit: Furthermore, would there be a way to quickly order PDF images via a pre-existing page number on the PDF file.
To get images of a webpage , you can use python script to fetch all the image src which later u can perform any operations on it , such as copy it to your system or into your website .
I've used BeautifulSoup for webscraping
from bs4 import BeautifulSoup
import requests
page = requests.get("https://stackoverflow.com/questions/63939080/is-there-a-fast-way-of-gathering-image-files-from-external-sources-chrome-devel")
soup = BeautifulSoup(page.content, 'html.parser')
#print(soup.prettify())
for element in soup.find_all("img"):
try:
print(element['src'])
except Exception as e:
pass

Original filetype of ashx file

I'm building a PHP application that uses data from a web service. I add an image to a desktop application which then saves it to the web. The web service provides image URLs using the .ashx file extension. If I put one of these in an <img src="file.ashx?pictureId=abc123">, it displays as an image.
I want to store these images. I know they'll generally be .jpg files and can run file_get_contents on this and save it as such. However, if one was a .png, for example, I'd still be saving it with a .jpg extension, so it's an assumption I don't wish to make.
I've had a look at the raw string of characters of the file and cannot see any identifying features to tell me that it's a .jpg, apart from perhaps the clue that it was created in Photoshop. Nowhere does it say what kind of file it was originally, either extension or original filename.
Is there a way of finding the original filetype of a file contained within .ashx URL?
The question doesn't make any sense. Maybe the .ashx script generates the image on the fly out of nothing and there is no "original".
The correct question is: how to find the type of the image retrieved from the .ashx URL?
Save the image into a (temporary) file then use getimagesize() to find its type (GIF, JPEG, PNG etc) and choose the correct termination for its final file name.

Magento Gif upload

I try to upload gif from admin panel of Magento2 for a feature, but it is not looping gif but a jpg at the frontend.
Looking for your advices which is also ok for Cache
Why dosent the uploaded Gif animated ? why isnt it looping ?
When you upload images to Magento i the Wysiwyg editor. it "prepares" your images for frontend. By doing so a version of the image is stored in cache preparation.
The function that handles this is not compatible with the .gif format, and therefore i takes the first image in the row of images contained in the .gif file.
You can upload you image with a FTP client like Filezilla or through Cpanel, and overwrite the gif you already uploaded. that way the function is not run on your file, and you will keep your animated image.
There is also modules that makes the Wysiwyg editor compatible with the .gif format, for more permanent soloutions.

Images not displaying in word File after linking images in the file

I have a word file.
I have inserted images by linking it to avoid more size of doc file. Here I have kept the all images into a folder and linked in the doc file. This works fine.
But, when I send to my friend the doc file the the image file, the images cannot be seen. Quite obvious due to path has been changed.
I don't want to host the images online. If I do, this will resolve if I'm online.
If I'm off line I can't view the images in the doc file.
How do I overcome this problem?
Why not just get your friend to edit hyperlinks to update it to location of each image on their machine?

How to add images and directories already on server to Magento media browser list of images and directories?

I've installed a new Magento Store and just pasted a media directory from another Magento Store. But when I try to insert images to some page or product using the WYSIWYG editor, I can upload new images and create new directories, but the images and directories that were copied does not appears.
What do I have to do to programmatically add this images and directories copied to the list of the "Magento's media browser"?
Below follows an image in case I didn't make this question clear enough. (You may notice some white squares, I just made a quick edit in this picture to hide the directories and images, as I can't show them)

Resources