Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-03-2009, 03:55 PM
|
#1
|
Senior Member
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126
Rep:
|
Convert text to image?
I would like to convert a lot of text to jpeg images.
I tried it from the command line using convert:
echo "This is some text to test if imagemagick is useable for converting text to image" | convert -page 500x360+0+0 -font Helvetica -style Normal -background none -undercolor white -fill black -pointsize 22 text:- +repage -background white -flatten text_box_trimmed.png
I supposed that the above command would wrap long text lines, but it did not. Long lines were truncated, instead.
I also tried it manually, by first converting the text to pdf by OpenOffice, then converting pdf to jpg by imagemagick.
This was also prevented by convert: it inserted a large blank area above the text, when converting it to jpeg. It seemed as if convert did not like the landscape-oriented pdf page, so it made a square-like image of it by inserting the blank area.
Is there a way to efficiently convert text to jpeg at the present immature stage of softwares on linux?
Edit:
Finally I succeded with the "inferior" method through pdf (using the -trim option to remoe the blank area). But the quality of the text on the resulting image is really bad this way. It just cannot be compared to the method when the conversion is made from text directly.
Last edited by J_Szucs; 04-03-2009 at 06:23 PM.
|
|
|
04-03-2009, 06:49 PM
|
#2
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083
|
I've never done this, but if the whole problem with imagemagick is that it doesn't wrap lines, you can do that previously with an external tool, can't you?
|
|
|
04-03-2009, 07:03 PM
|
#3
|
Senior Member
Registered: Jun 2008
Posts: 1,821
|
A guess...
Doesn't OpenOffice Draw allow saving documents as jpeg? You might have to go by way of Writer, if you could get the text composed there in the form you want.
Last edited by thorkelljarl; 04-03-2009 at 07:06 PM.
|
|
|
04-04-2009, 11:34 AM
|
#4
|
Member
Registered: Oct 2004
Location: Stoney Stanton - England
Distribution: openSuse tumbleweed
Posts: 329
Rep:
|
The way I do this is to type the text using koffice, then use ksnapshop to picture the screen and then edit the jpg. Not a very neat way but it works.
|
|
|
04-04-2009, 02:22 PM
|
#5
|
Senior Member
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094
Rep: 
|
Quote:
Originally Posted by i92guboj
I've never done this, but if the whole problem with imagemagick is that it doesn't wrap lines, you can do that previously with an external tool, can't you?
|
The fold command comes to mind.
Code:
echo "blah blah blah" | fold -w a_number
As ever, 'man fold' for more info.
|
|
|
04-04-2009, 02:48 PM
|
#6
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,685
|
i would just have OO save the text as a pdf then open that pdf in gimp and save that as a *.jpg ( i would use png , but that is just me )
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 04:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|