LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-14-2005, 01:35 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Rep: Reputation: 52
Converting to .jpg format


Hi folks,

FedroaCore2

1) Which simple tool shall I use to convert/save/print files of following format to .jpg

.txt
.doc
.pdf

2) After converson, if the original file has several pages can the output file be a single .jpg file instead separate .jpg files.

3) Can a webpage be printed/saved as .jpg format

TIA

B.R.
satimis
 
Old 03-14-2005, 01:44 AM   #2
tormented_one
Member
 
Registered: Oct 2004
Location: Small Town USA
Distribution: slamd64 2.6.12 Slackware 2.4.32 Windows XP x64 pro
Posts: 383

Rep: Reputation: 30
GIMP might work, but that is just a guess.
 
Old 03-14-2005, 02:59 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi tormented_one,

Tks for your advice.

Yes GIMP can do the job, but not suitable my application.

What I'm trying to do is to attach the .jpg files to an email/webmail. The receipiant can read them directly upon opening the email/webmail without further clicking the attached files to read.

B.R.
satimis
 
Old 03-14-2005, 04:46 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 53
There's a util called gozer than can render text in jpg format, but I don't know about doc or pdf. You'd probably be able to convert the doc to txt using some sort of filter, but the pdf...no idea.
 
Old 03-14-2005, 06:15 PM   #5
perl21
LQ Newbie
 
Registered: Mar 2005
Location: Las Vegas NV
Distribution: Suse 9.2
Posts: 23

Rep: Reputation: 15
ImageMagick?

Have you tried the convert utility from ImageMagick?

I've had success converting PDF to jpg with it.

http://www.imagemagick.org/www/convert.html

Not sure about .txt & .doc format

For .doc format you might find a linux utility that converts doc to pdf then you can use `convert` to go from there to jpg.

You may want look for a windows batch file converter and run it using wine. I use wine to convert m4p files to m4a files with perl on linux.
 
Old 03-16-2005, 09:51 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi Komakino,

Tks for your advice.

Quote:
There's a util called gozer than can render text in jpg format, ......
whether you meant

http://www.linuxbrit.co.uk/gozer/

I never use it.

B.R.
satimis
 
Old 03-16-2005, 09:52 AM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Re: ImageMagick?

Quote:
Originally posted by perl21
Have you tried the convert utility from ImageMagick?

I've had success converting PDF to jpg with it.........
Noted with thanks

B.R.
satimis
 
Old 03-17-2005, 03:32 AM   #8
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 30
Are you sure that GIMP is not suitable? I haven't tried it, but I think you can use it from CLI.

http://www.gimp.org/tutorials/Basic_Batch/
 
Old 03-17-2005, 06:31 AM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi enemorales,

Tks for your URL

Quote:
Are you sure that GIMP is not suitable? I haven't tried it, but I think you can use it from CLI.

http://www.gimp.org/tutorials/Basic_Batch/
I am pretty sure GIMP (GUI) can do the job. Athough I'm not very experienced on GIMP, I have been using Adobe PhotoShop for sometimes. They are quite similar. But GIMP is a heavy tool to do this simple job.

I'm not knowledgeable on command line of GIMP.

Now after saving the sample script (A simple example) listed on

http://www.gimp.org/tutorials/Basic_Batch/

to ~/.gimp-2.2/scripts/XYZ.scm

What shall I do with following command line
gimp -i -b '(simple-unsharp-mask "foo.png" 5.0 0.5 0)' '(gimp-quit 0)'

If the file to be converted is a .txt or .pdf file namely AAA.txt/AAA.pdf and the output file is BBB.png. What I shall enter. Please advise.

TIA

B.R.
satimis
 
Old 03-17-2005, 10:01 AM   #10
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Try the tool called enscript . It can convert text files to ps or jpg type. It did convert a doc file for me but the output was garbage. Maybe that could be fixed by saving the doc file as text first.
Also, the command is not what you may expect as the output file is typed before the input file name.

For example:
Code:
enscript -p test.jpg test.txt
or 
enscript -p test.ps test.txt
 
Old 03-17-2005, 04:20 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
Why on earth do you want to make a text into
a jpg? (ASCII)Text is (unless you consider (g)zip/bzip2)
the most efficient (in terms of size and this cost
of transport) format available?


Cheers,
Tink
 
Old 03-17-2005, 06:57 PM   #12
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi Tinkster,

Quote:
Why on earth do you want to make a text into....
My target is to breakthrough languages/fonts barrier assisting the recipiants of email to read its attachments which are edited in Chinese/Japanese.

There are still some funny folks on this globe, knowing nothing to install fonts. They are still running M$Win/ME/98, knowing nothing about "update". They only know browsing Internet, sending emails, text editing, etc. They rely on other people to fix the PC for them to use. They even don't know how to get Acrobat Reader from Internet, free of Charge. If you send them emails with attachments other than .jpg/.png format they don't know how to open/read the same. If the attachments being on .htm/.html format and they don't have the same fonts installed they can't read the attachments. They totally rely on the senders assisting them to read the attachments. For such a reason and in my consideration, the simplest way is to send them pictures in .jpg/.png format.

Our folks won't have this problem.

B.R.
satimis
 
Old 03-17-2005, 09:51 PM   #13
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,385

Original Poster
Rep: Reputation: 52
Hi homey,

Tks for your advice.

Quote:
Try the tool called enscript . It can convert text files to ps or jpg type. ...
I ran

# yum install enscript

installing the package.

It worked nicely with English .txt file. However it did not work on Chinese .txt

$ enscript -p testfile.jpg testfile_cn.txt
[ 1 pages * 1 copy ] left in hope_lee_data-050221_spare_cn.jpg
21 non-printable characters

$ enscript -p testfile.ps testfile_cn.txt
same result

Any suggestion? Which flag I have to raise/up.

TIA

B.R.
satimis
 
Old 03-17-2005, 10:45 PM   #14
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
That's definitely new turf for me so I can only guess.

This is from: man enscript
Code:
      -E[lang], --pretty-print[=lang]
               Pretty-print source code by creating a special input filter with the states pro-
               gram.   Optional argument lang specifies the language to highlight, as a default
               states makes an educated guess.

               A description of supported  highlighting  languages  and  file  formats  can  be
               printed with command:

               enscript --help-pretty-print

               The highlighting rules are defined in the Ď/usr/share/enscript/enscript.stí file
               which can be edited to create highlighting definitions for new languages.

               Note! You canít use your own input filters with this option.

Last edited by homey; 03-17-2005 at 10:53 PM.
 
Old 04-05-2005, 12:02 PM   #15
pld
Member
 
Registered: Jun 2003
Location: Southern US
Distribution: Ubuntu 5.10
Posts: 206

Rep: Reputation: 30
Just wanted to chime in here. I am in the process of trying to do the same thing (.txt -> .jpg) for upload onto my PSP. I have a bunch of ebooks, and the allure of that large screen is too much to resist.

As such, convert has been working very very well for me. I still have a few questions about specifying output size, etc., but the files are quite usable and clear. Might wanna explore that a little more...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting .png to .jpg GtkUser Linux - Software 9 04-17-2007 02:04 PM
Converting wma format to mp3 format. fakie_flip Linux - General 6 10-02-2005 07:49 PM
mencoder problem converting *.jpg to .avi whistl Linux - Software 9 06-29-2005 01:32 PM
Converting Sid files to Tif or jpg nguye103 Linux - General 4 02-09-2005 03:57 PM
hi .. how i print screen and save it as jpg or other format? New In Linux 11 Linux - Newbie 4 07-28-2004 05:56 PM


All times are GMT -5. The time now is 08:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration