Macro for setting background image

Hi everyone. I’m a recent convert to Libreoffice and I love it. Using the latest portable version on Windows 11.

I’m wanting to setup a bit of automation. I produce postage labels for things I sell online. My current process is this:

Purchase labels
Convert pdfs to jpgs (pages are the labels, 6x4)
Open Libreoffice draw doc
Set the background image for each page/label
Print

With the help of ChatGPT I’ve automated converting each pdf to a jpgs but I’m a bit stuck on how to import those pages into my current document.

ChatGPT suggested a macro that doesn’t seem to work and errors.

I’m wondering if I get my batch script to list the files would I be able to set a macro to import these files from the list into the first page, then duplicate that page and insert the next image etc… Ideally I would want it to print once imported but I’ll look into that after this hurdle.

Any advice and help would be amazing.

Thank you for taking time to read.

not sure why you’d need LO :

Thanks! This worked a treat, don’t even need to use LibreOffice for the process now!

One click and it converts, crops, overlays and prints! Going to save me a lot of time!