LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 04-04-2011, 12:22 PM   #1
noeldum
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora, Rhel4, Debian
Posts: 13

Rep: Reputation: 0
Creating a simple postscript file


Hi,

I would like to do something that should be fairly simple but can not find a way for it.

I want to make a page in postscript or pdf format containing four lines of text and two png images.

Would you know an easy way to concatenate my text file with the two images in a ps or pdf file?

I need a solution that works via command line only as this is for a script.

I use redhat 5 for this and would prefer not having to install any extra software.

Last edited by noeldum; 04-04-2011 at 12:30 PM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-04-2011, 12:41 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,729
Blog Entries: 23

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Hey!

Not difficult...do you have OpenOffice installed? Or LibreOffice (the successor)? Open the writer, set up your text/page and export as...pdf. File-Export-name the file-set as PDF.

Alternatevily, use Scribus. There text and images are treated as blocks. Insert a text/image block, get the text/image to display, move it on the page where needed, follow file-expost and save as PDF.

Quote:
I use redhat 5 for this and would prefer not having to install any extra software.
I think redhat 5 could still have an office suite...but you may have to accept installing something...

Wellness!

Thor
EDIT : an other alternative is to use a live CD. It does not affect the hard drive, you can "install" stuff (stays in RAM), do what you need to do and reboot without the CD.
Fedora's Live CD's are pretty good, and it's all in the redhat farm...

Last edited by ButterflyMelissa; 04-04-2011 at 01:01 PM.
 
Old 04-04-2011, 04:46 PM   #3
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,900

Rep: Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782Reputation: 782
http://pages.cs.wisc.edu/~ghost/doc/cvs/Use.htm

Ghostscipt. Most flavors of unix and BSD have it in their repositories.
 
3 members found this post helpful.
Old 04-07-2011, 06:48 PM   #4
noeldum
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora, Rhel4, Debian
Posts: 13

Original Poster
Rep: Reputation: 0
Ghostscript to probably what I need. I check what is in your link but there is a lot in here. Would you guide to just output my three files in one document? Any example?

In short I need something to make a pdf from command line.
 
Old 04-07-2011, 08:23 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,191

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
I use Latex for that purpose.

jlinkels
 
2 members found this post helpful.
Old 04-08-2011, 04:22 PM   #6
noeldum
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora, Rhel4, Debian
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for pointing to Latex. I went through this option during my search. I might consider this now.

ANy quick example in latex to make one document which include a text file and a png picture together?
 
Old 04-08-2011, 06:13 PM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by noeldum View Post
...ANy quick example in latex to make one document which include a text file and a png picture together?
Code:
\documentclass{minimal}
\usepackage{graphicx}
\begin{document}
Hello World!

\includegraphics{mypicture.png}
\end{document}
be sure to have a picture "mypicture.png" in the same directory as the LaTeX file (which has to have a "*.tex" name).

Markus

Last edited by markush; 04-08-2011 at 06:14 PM.
 
Old 04-08-2011, 07:25 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,379

Rep: Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598Reputation: 3598
A very simple tool
http://webpages.cs.luc.edu/~rig/home/bin/text/txt2ps
Code:
#!/bin/csh -f

enscript -p$1:rout.ps $1:rtextfile.txt
... Will convert textfile.txt into out.ps

Even simpler : enscript -p$1out.ps $1textfile.txt

..

Last edited by knudfl; 04-08-2011 at 07:34 PM.
 
1 members found this post helpful.
Old 04-20-2011, 09:44 PM   #9
noeldum
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora, Rhel4, Debian
Posts: 13

Original Poster
Rep: Reputation: 0
How do you add picture in your ps file with enscript?

I have visited the latex option and tried the few lines of code given. However I am running in some problem with boxing area of the picture I am trying to insert.
 
Old 04-21-2011, 05:50 AM   #10
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,191

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
What do you mean with "boxing area?"

jlinkels
 
Old 04-21-2011, 05:59 AM   #11
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello noeldum,

I think you should tell us in more detail what your really want to achieve. Maybe there is an easier approach to your real problem.

Markus
 
Old 04-21-2011, 06:59 AM   #12
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.0
Posts: 1,337

Rep: Reputation: 259Reputation: 259Reputation: 259
The red (i.e. Reference Manual) and older green and blue books of Postscript are now freely available and there is also Thinking in Postscript to mention.

They are all linked at the end of the Wikipedia entry.

Output just text is the easy part:
Code:
%!PS-Adobe-2.0 
/Helvetica findfont 24 scalefont setfont
50 250 moveto
(This is the first line.) show
50 200 moveto
(This is the second line.) show
50 150 moveto
(This is the third line.) show
50 100 moveto
(This is the fourth line.) show
showpage
 
Old 04-24-2011, 09:40 PM   #13
noeldum
LQ Newbie
 
Registered: Jun 2007
Distribution: Fedora, Rhel4, Debian
Posts: 13

Original Poster
Rep: Reputation: 0
To answer Markus what I want to do is to create a ps or pdf from one of my script. This document just need to have four lines of text at the top and two image file (png) underneath. The exact layout of the page does not matter much. As long as the information is there it's all good. It must run on redhat 5 and be as much portable as possible. Hence avoiding extra installation package.

I have now managed something concerning this. Not ideal though. If you guys know a much simpler way to do it please feel free to post it.

This is how I approach the problem.
I create an html file which include my text and the two images. This is easily done by text editing.
I then use the html2ps script from http://user.it.uu.se/~jan/html2ps.html (luckily for portability this script can be provided with my own script).

Thanks to all...
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
While installing Simple scalar utility 990811 on FC 13, make file is not creating kpradheep Linux - Embedded & Single-board computer 6 03-04-2011 01:16 PM
Creating a simple file system module Raynus Linux - Kernel 2 10-07-2008 06:39 PM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 05:22 AM
Creating a postscript output from a image and text rdfoerster Linux - Software 3 08-31-2004 10:26 AM
~ how to edit postscript file ~ alvincks Red Hat 1 09-30-2003 06:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:46 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration