Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64104

Re: Converting folders of jpegs to single pdf per folder

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Converting folders of jpegs to single pdf per folder
Date 2014-01-16 20:01 +0000
References <CAJ3b0o828ZOAYM8Gt0BsLcZ97beGAnQWT9C+_7yFE4HSjiiU3Q@mail.gmail.com> <mailman.5602.1389901256.18130.python-list@python.org> <0c648d2d-d8b3-4848-8b37-1e5e1ae40327@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.5603.1389902490.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 16/01/2014 19:50, vasishtha.spier@gmail.com wrote:
> On Thursday, January 16, 2014 11:41:04 AM UTC-8, Tim Golden wrote:
>> On 16/01/2014 19:11, Harry Spier wrote:
>>
>>>
>>
>>> Dear list members,
>>
>>>
>>
>>> I have a directory that contains about a hundred subdirectories named
>>
>>> J0001,J0002,J0003 . . . etc.
>>
>>> Each of these subdirectories contains about a hundred JPEGs named
>>
>>> P001.jpg, P002.jpg, P003.jpg etc.
>>
>>>
>>
>>> I need to write a python script that will cycle thru each directory and
>>
>>> convert ALL JPEGs in each directory into a single PDF file and save
>>
>>> these PDF files (one per directory) to an output file.
>>
>>>
>>
>>> Any pointers on how to do this with a Python script would be
>>
>>> appreciated. Reading on the internet it appears that using ImageMagick
>>
>>> wouldn't work because of using too much memory. Can this be done using
>>
>>> the Python Image Library or some other library? Any sample code would
>>
>>> also be appreciated.
>>
>>
>>
>> The usual go-to library for PDF generation is ReportLab. I haven't used
>>
>> it for a long while but I'm quite certain it would have no problem
>>
>> including images.
>>
>>
>>
>> Do I take it that it's the PDF-generation side of things you're asking
>>
>> about? Or do you need help iterating over hundreds of directories and files?
>>
>>
>>
>> TJG
>
> Its mostly the PDF generating side I need but I haven't yet used the Python directory and file traversing functions so an example of this would also be useful especially showing how I could capture the directory name and use that as the name of the pdf file I'm creating from the directory contents.
>
> Thanks again,
> Harry
>

I'm sorry that I can't help with your problem, but would you please read 
and action this https://wiki.python.org/moin/GoogleGroupsPython to 
prevent us seeing the double line spacing above, thanks.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Converting folders of jpegs to single pdf per folder Tim Golden <mail@timgolden.me.uk> - 2014-01-16 19:41 +0000
  Re: Converting folders of jpegs to single pdf per folder vasishtha.spier@gmail.com - 2014-01-16 11:50 -0800
    Re: Converting folders of jpegs to single pdf per folder Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-16 20:01 +0000
    Re: Converting folders of jpegs to single pdf per folder Tim Golden <mail@timgolden.me.uk> - 2014-01-16 20:07 +0000
      Re: Converting folders of jpegs to single pdf per folder vasishtha.spier@gmail.com - 2014-01-16 21:42 -0800
        Re: Converting folders of jpegs to single pdf per folder Tim Golden <mail@timgolden.me.uk> - 2014-01-17 08:53 +0000
        Re: Converting folders of jpegs to single pdf per folder Tim Golden <mail@timgolden.me.uk> - 2014-01-17 09:01 +0000
    Re: Converting folders of jpegs to single pdf per folder Tim Golden <mail@timgolden.me.uk> - 2014-01-16 20:12 +0000
      Re: Converting folders of jpegs to single pdf per folder vasishtha.spier@gmail.com - 2014-01-16 12:20 -0800

csiph-web