LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-09-2007, 10:13 AM   #1
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Rep: Reputation: 0
lpr command to scale a postscript to A3 paper


Hi all, I've got this problem that I've been trying to solve for some time but nothing so far seems to work. Basically I need to print a postscript file (which is actually a screenshot of a program) to A3 paper, using the lpr command if possible. The problem now is that when I print it to an A3 paper, the screenshot only fills up around 1/4 of the paper, which is like an A4 size. I need to scale it to fill the whole A3 paper.

I've tried searching around and have tried different commands like
lpr -Zmedia=A3 -Zscaling=100 snapshot.ps
lp -omedia=A3 -oscaling=100 snapshot.ps
lpr -ZPageSize=A3 -Zscale=10 snapshot.ps

things like that. But none of them seems works. The only time I got it to fill the whole paper was when I used GIMP to scale and print it...but that's not what I want. I want to use command line only, if possible. Does anyone have any solutions or suggestions? I'm currently using Redhat 7.1, with LPRng 3.7.4-22 installed. I can't change my redhat or LPRng version due to some restrictions.

Any suggestions would be greatly appreciated. Thanks in adv.
 
Old 07-09-2007, 12:16 PM   #2
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
There's a program/script called poster that will do all sorts of things from the CL
It can scale, rotate, and even print an image across multiple pages. Perhaps it will help you.
See this thread, from last month:
http://www.linuxquestions.org/questi...14#post2798514
D/L the program from the link in (my) post #4 and take a look at its manual.ps

& welcome to LQ!
 
Old 07-10-2007, 04:31 AM   #3
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a lot! I'll try it tomorrow in the office and will let you know the results.
 
Old 07-10-2007, 05:00 AM   #4
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
And there's psresize

Code:
psresize -PA3 infile outfile

Cheers,
Tink
 
Old 07-10-2007, 07:59 PM   #5
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Original Poster
Rep: Reputation: 0
OK, here's the update. When i execute this command
poster -mA3 -pA3 snapshot.ps -o outfile

the postscript file did get resized to fit an A3 paper nicely. I haven't tested printing it yet, I only did a gv outfile to see a preview. The problem is, some parts that was in my original postscript file didn't get converted and saved into the outfile.

I'm not sure whether there's such a thing as layers for postscript file, because the "background" portion of my ps file got converted but not the "foreground" portion. So now all I see in the outfile is the background of my original ps file in A3 size. Any idea? In the meantime I'll try to see if I can like...compress the ps file and convert it again.

Thanks a lot of your help!
 
Old 07-10-2007, 08:08 PM   #6
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
No idea about poster, but did you try psresize?



Cheers,
Tink
 
Old 07-10-2007, 08:40 PM   #7
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster
And there's psresize

Code:
psresize -PA3 infile outfile

Cheers,
Tink

Hey, it works! Executed psresize -pA3 infile outfile though and it resized just the way I wanted. Thanks a lot Tinkster & tredegar for your help!
 
Old 07-10-2007, 10:25 PM   #8
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Original Poster
Rep: Reputation: 0
Hi, having a small problem again. The psresize commands works beautifully on my machine. However, if I were to execute the same command on another machine, or even on a postscript file that is on a network-mounted directory, the output file will be exactly the same as the original file. But when I resize it on my own machine (local directory), it works just fine. I can resize an A4 postscript to A3. Any idea what could be the problem? All the machines are on redhat 7.1

The only difference is that mine is on VMware.
 
Old 07-11-2007, 02:10 AM   #9
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
The first thing that springs to mind would be permission
problems ... what happens if you create the resized file
on the local filesystem when the original resides on the
network? e.g.

psresize -PA3 /path/to/share/file.ps ~/new_files.ps



Cheers,
Tink
 
Old 07-11-2007, 03:33 AM   #10
n34tsd
LQ Newbie
 
Registered: Jul 2007
Distribution: Redhat 7.1, Enterprise 4/5
Posts: 11

Original Poster
Rep: Reputation: 0
Yup, I initially thought that it was a permission problem. But the output file can be written to the network-mounted drive, so it's unlikely to be permission problem.

I kinda found out the cause of problem already, though I don't really know why. Apparently, I have to execute ps2ps on the original postscript file and then run psresize on the output file. For example, the program that generates the original postscript file is called screenshot.ps

So I have to run:
ps2ps screenshot.ps outfile.ps
psresize -pA3 outfile.ps final_outfile.ps

If I were to simply run psresize on screenshot.ps, nothing would change. But if I were to execute ps2ps or maybe open it in Gimp and save it, psresize will work. I guess some formatting is lacking in the original postscript file, thus psresize wouldn't work. At least I learn something new today, and I got my problem solved =D

Thumbs up for LQ, wouldn't have done it without the help of you guys!
 
  


Reply

Tags
postscript, resize


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
about lpr command and source ip of lpr command Fond_of_Opensource Linux - Newbie 1 04-11-2007 07:35 AM
Postscript not converted fully into pdf using ps2pdf command lijomathai Linux - Server 1 12-21-2006 08:55 AM
lpr command error mikeshn Linux - Software 0 11-17-2003 12:04 PM
printer keeps trying to print postscript. works fine using lpr Choey Linux - Hardware 1 09-20-2003 06:06 PM
command line for gs and lpr in Mozilla rich442 Slackware 0 04-27-2003 02:45 PM


All times are GMT -5. The time now is 11:06 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