How do I find the file path of images in a folder so I can extract them and put them on a pdf ?

Options
DataAnalyst24
DataAnalyst24 Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 7
edited July 16 in Using Dataiku

I have the flow below where I want to use the images stored in the Photos folder?
FlowFolder with Images.PNG

In the folder, there are two images, how can I get those images and add them into the script below that allows me to create pdf files. This part of the script is where the error is coming

pdf.image('/project/XX1111/ABC12DDD/apple.jpeg')

import fpdf
from fpdf import FPDF

# Create instance of FPDF class
pdf = FPDF()

# Add a page
pdf.add_page()

# Set font
pdf.set_font("Arial", size = 15)

# Add a cell
pdf.cell(200, 10, txt = "Hello World", ln = True, align = 'C')

# Save the pdf with name .pdf
pdf.output("report.pdf")

#Add-Image
folder = dataiku.Folder("Photos")
Photos_info = Photos.get_info()
display(Photos_info)
images_folder = dataiku.Folder('ABC12DDD')

# pdf.image(im)
pdf.image('/project/XX1111/ABC12DDD/apple.jpeg')

This is the error I get

RuntimeError: FPDF error: Missing or incorrect image file: /project/XX1111/ABC12DDD/apple.jpeg. error: [Errno 2] No such file or directory: '/project/XX1111/ABC12DDD/apple.jpeg

Answers

Setup Info
    Tags
      Help me…