[Gimp-user] Cannot use function file-pdf-save-multi



Attached file with correct formatting.

file-pdf-save-multi requires an array of image ids:
This is my python code:

#
# PDF file-pdf-save-multi python-fu example
# TESTED ON:
# GIMP 2.10.12 Python Console
# Python 2.7.16 (default, May 28 2019, 08:10:12)  [GCC 8.3.0 64 bit
(AMD64)]
#
# Get image array
images = gimp.image_list()
#
# Optionally sort by filename to order pages by filename
# images.sort(key=lambda x: x.filename, reverse=False)
#
# Extract ids from image array
images_ids = [img.ID for img in images]
#
# Save multi page pdf
pdf_filename = "/tmp/multipage_output.pdf"
pdb.file_pdf_save_multi(len(images), images_ids, False, True, False,
pdf_filename, pdf_filename)

Attachments:
* https://www.gimpusers.com/system/attachments/1277/original/file-pdf-save-multi-example.py

-- 
renzofilini (via www.gimpusers.com/forums)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]