- Compose HTML File - used to compose the HTML body. In it, you can see the HTML markup that points to an image (e.g. https://<YOUR TENANT>postmediacanoe.files.wordpress.com/2018/09/jackolanterns1000.jpg).
- Create file - this is where the HTML is converted into a temporary file, temp.html
- Convert file using path - here, the HTML file is converted into PDF. Note that this action doesn't actually save the PDF file; it just converts the content.
- Create file 2 - now, I use the content from action 3 to save the PDF content into a PDF file.
If you look at the temp.html file, you will see the image as expected:
However, if you try to open the corresponding PDF file, the image is missing.
The reason for this is that the Convert file using path action is expecting all the content to exist within the source document (the HTML file). So, the way to get around this is by extracting the content of the image and including it directly within the HTML body. Let's have a look at the updated Flow:
I added the Get file content using path to capture the content of the Halloween.png file. Next, I modified the Compose action to (specifically the <img ...> tag) to include the content of the image. For the image content itself, you need to include the following expression:
Note that the name of the body object may be different in your case. Now, when you generate the PDF, you get the image included in it.
As you can see in the final image, the Halloween picture is larger in the PDF file than in the HTML file. Make sure to structure your HTML carefully to properly size the images and other content.