Post Reply 

Load PDF and load images

Aug 7, 2014, 16:30
Post: #1
Question Load PDF and load images
Hi

I want that help me with two problems

How can I open all pages of PDF file in Gimp with Python-fu?, I've found
pdb.file_pdf_load but I don't know how to use Dodgy I've searched information however I do not understand because not work for me, please help me I could tell me how to use

How can I open all images of a directory in Gimp, only I want open all images, with python--fu

Best regards
Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 17:03
Post: #2
RE: Load PDF and load images
1) seems it loads only the first page:
Code:
image = pdb.file_pdf_load('/path/to/the/file.pdf','/path/to/the/file.pdf')
display=gimp.Display(image)

... and is also missing all the useful options of the interactive version (print definition, etc...)

2) use the glob.glob() function (import the "glob" module) to obtain a list of files in the directory and then feed them one by one to the relevant file-load functions.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 18:18
Post: #3
RE: Load PDF and load images
(Aug 7, 2014 17:03)ofnuts Wrote:  1) seems it loads only the first page:
Code:
image = pdb.file_pdf_load('/path/to/the/file.pdf','/path/to/the/file.pdf')
display=gimp.Display(image)

... and is also missing all the useful options of the interactive version (print definition, etc...)

2) use the glob.glob() function (import the "glob" module) to obtain a list of files in the directory and then feed them one by one to the relevant file-load functions.

thank you for response

1) yes, only has loaded the first page Confused
how can I load all pages?

2) I did not know this "gimp_display_new" therefore was not working
Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 19:14 (This post was last modified: Aug 7, 2014 19:14 by ofnuts.)
Post: #4
RE: Load PDF and load images
Maybe use some external PDF processor to split the PDF into invidual page files. This one looks good (but I didn't try it). There are also online sites.

In python, best use pythonic code when you can.

Code:
display=gimp.Display(image)

is more readable and does exactly the same thing as:

Code:
display=pdb.gimp_display_new(image)

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Aug 7, 2014, 20:05
Post: #5
RE: Load PDF and load images
(Aug 7, 2014 19:14)ofnuts Wrote:  Maybe use some external PDF processor to split the PDF into invidual page files. This one looks good (but I didn't try it). There are also online sites.

In python, best use pythonic code when you can.

Code:
display=gimp.Display(image)

is more readable and does exactly the same thing as:

Code:
display=pdb.gimp_display_new(image)

1) I will use ghostscript, I wanted know If I could do it with gimp
2) thank for your suggestion

thank you for all Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Batch create images from array edmilner 1 115 Jul 17, 2017 16:41
Last Post: ythgilb
Question Wanting to find / create a script which stitches images together PantsOnFire 3 314 Aug 12, 2014 23:32
Last Post: ofnuts
  How to get python module to load? Michael the Narwhal 1 472 Apr 16, 2014 17:05
Last Post: ofnuts
  Batch conversion of PDF file ? eljay 7 6,026 Oct 21, 2013 10:20
Last Post: almien
  Bash command line to open two images into GIMP layers lwhistler 2 975 Sep 23, 2013 08:18
Last Post: rich2005

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS