Connect Current Galley Image to Generated PDF

Hello to everyone. I already did another post about this, but I’ll give it another try in case this time someone is available :slight_smile:
I have a real estate website and I followed all the instructions by @Salman and @Yisrael (Wix) in order to generate a PDF of a property with PDF Generator API. (Great tutorials!) It is working perfectly, however, for some reason I haven’t been able to connect the first image of the property gallery to the PDF. Therefore, when I download the PDF it displays all current info of the property perfectly except the image. I am new with code so maybe I am just making the relevant line wrong… Please note I am running this code in a dynamic page so the pdf generates with the current info of the chosen property.
What am I doing wrong?

Here is my front page code:

export async function button24_onClick(event) { 
const name = $w('#text180').text; 
const zona = $w('#text266').text; 
const status = $w('#text177').text; 
const venta = $w('#text178').text; 
const arriendo = $w('#text264').text; 
const tipodeinmueble = $w('#text170').text; 
const alcobas = $w('#text163').text; 
const banos = $w('#text159').text; 
const descripcion = $w('#text175').text; 
const currentItem = $w("#gallery1").currentItem; //THIS IS THE LINE THAT WONT WORK 

const pdfUrl = await getPdfUrl({ name, zona, status, venta, arriendo,tipodeinmueble, alcobas, banos, descripcion, currentItem })    

wixLocation.to(pdfUrl); }

The key for my image in the PDF Generator template is also {currentItem}. Here is a screenshot of the template so you can see the variables.

This is the resulting PDF showing no image:

Thank you

Have you tried, instead of:

const currentItem = $w("#gallery1").currentItem;

this:

const currentItem = $w("#gallery1").currentItem.src;

Note: if you get into trouble exporting a Wix-image (with the src":“wix:image://v1/99bc1c6f66…” -syntax to something that can be reached from outside: that has been asked and solved many times here on the Forum

Everything works for you?