LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2010, 04:26 AM   #1
dili
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Rep: Reputation: 0
Question sequence and merge jpeg images using pyhton?


hi,

Im doing a project as part of academic programme.Im doing this in linux platform.
Here i wanted to create a application which retreive some information from some pdf files .

For eg i have pdfs of subject2,subject1,in both the whole pdf is divided in to 4 modules and i want to get the data of module 1 from pdf.

For this purpose i have used PDFTOHTML application and converted pdf files to html and jpeg images.

Now i want to create a pyhton script which will combine the pages(which have been coverted in to jpeg images) under module 1 and merge it into a single file and then i will convert it back to pdf .

How can i do this?.If anyone can provide any such python script which have done any functions similar to this then it will be very helpful.

.... thanks in advance

Last edited by dili; 06-11-2010 at 03:01 AM.
 
Old 06-10-2010, 04:46 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Please define "sequence" and "merge" more precisely. Do you want to number them (in their filename)? Put them together in an animation?

To get you started, maybe you can have a look at ImageMagick (http://www.imagemagick.org). Can work from commandline
and has a Python interface you can use. I use it regularly for animations, mosaics,...

Why does it have to be a Python script?
 
Old 06-10-2010, 06:11 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
dili;

You have edited your original post after the reply from timmeke. I cannot tell if you have changed something in response to timmeke's questions.

Please post a reply to clarify what you are doing.
 
Old 06-10-2010, 06:13 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
PS:
Please use capitals at the beginning of each new sentence (and an extra space or two.)
 
Old 06-10-2010, 10:06 AM   #5
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
ImageMagick's convert tool should be able to put the JPEG images into one PDF file.
But then again, as it's your tutor who asked this... it's homework and the forum should not help you any further...(read the forum rules)
 
Old 06-11-2010, 02:58 AM   #6
dili
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Original Poster
Rep: Reputation: 0
what sequence and merge means?

I have number of jpeg images(which is produced using pdftohtml tool by converting a pdf file). Now i need to take some images based on some condition(which i have vaguely specified in original post) and group it in to a single file and convert that file back to pdf

i believe the idea is somewhat clear

thanks for replies
 
Old 06-11-2010, 03:09 AM   #7
dili
LQ Newbie
 
Registered: Apr 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Hi timmeke:

Thanks for your reply

Its not a homework given to me by my tutor. I just used word tutor in place of Advisor who advised me to convert pdf to jpeg images

Im a newbie in python and ,so first all dont know whether this could done using python.If i could get a similar script then i will be able to study and make my own script for this purpose.

I desparetly need help as the project is not moving forward

If you could help me then i will be very thankful

dili
 
Old 06-11-2010, 05:04 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Again, read the posts - ImageMagick's convert command can do that easily. And answer the question - why does it *have* to be in Python?
Python could call the convert (as external command) or you could try to use ImageMagick's Python interface. Just google for some examples.

Code:
convert -adjoin /path/to/your/desired/JPEGs out.pdf
should do the trick. There are plenty of options to toy with too.

Edit: Perhaps it's easier to delete the undesired JPEGs or to single out the desired ones (copying to a separate folder).
That's just a way to break up the problem into smaller pieces.

Last edited by timmeke; 06-11-2010 at 05:05 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a pdf/ps album of jpeg images hamtavs Linux - Software 3 12-21-2006 06:28 AM
Why can't I see .jpeg background images in GNOME? Vitalie Ciubotaru Linux From Scratch 5 09-10-2006 09:28 AM
viewing jpeg images in kde justwantin Slackware 5 11-15-2005 03:30 PM
Parse information from images (jpeg..etc) chrisk5527 Linux - General 4 10-22-2005 11:08 AM
displaying jpeg images Dave31836 Programming 2 01-25-2005 10:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration