LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Converting to .jpg format (https://www.linuxquestions.org/questions/linux-general-1/converting-to-jpg-format-301346/)

satimis 03-14-2005 01:35 AM

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

tormented_one 03-14-2005 01:44 AM

GIMP might work, but that is just a guess.

satimis 03-14-2005 02:59 AM

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

Komakino 03-14-2005 04:46 PM

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.

perl21 03-14-2005 06:15 PM

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.

satimis 03-16-2005 09:51 AM

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

satimis 03-16-2005 09:52 AM

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

enemorales 03-17-2005 03:32 AM

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/

satimis 03-17-2005 06:31 AM

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

homey 03-17-2005 10:01 AM

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


Tinkster 03-17-2005 04:20 PM

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

satimis 03-17-2005 06:57 PM

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

satimis 03-17-2005 09:51 PM

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

homey 03-17-2005 10:45 PM

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.


pld 04-05-2005 12:02 PM

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...


All times are GMT -5. The time now is 11:41 AM.