Hello to everyone. I already did another post about this, but I’ll give it another try in case this time someone is available
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