LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Creating a simple postscript file (https://www.linuxquestions.org/questions/linux-software-2/creating-a-simple-postscript-file-872915/)

noeldum 04-04-2011 12:22 PM

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.

ButterflyMelissa 04-04-2011 12:41 PM

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

teckk 04-04-2011 04:46 PM

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

Ghostscipt. Most flavors of unix and BSD have it in their repositories.

noeldum 04-07-2011 06:48 PM

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.

jlinkels 04-07-2011 08:23 PM

I use Latex for that purpose.

jlinkels

noeldum 04-08-2011 04:22 PM

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?

markush 04-08-2011 06:13 PM

Quote:

Originally Posted by noeldum (Post 4318456)
...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

knudfl 04-08-2011 07:25 PM

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

..

noeldum 04-20-2011 09:44 PM

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.

jlinkels 04-21-2011 05:50 AM

What do you mean with "boxing area?"

jlinkels

markush 04-21-2011 05:59 AM

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

Reuti 04-21-2011 06:59 AM

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


noeldum 04-24-2011 09:40 PM

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


All times are GMT -5. The time now is 09:31 PM.