LinuxQuestions.org
Visit Jeremy's Blog.
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 03-13-2014, 11:29 AM   #1
Axel van Moorsel
Member
 
Registered: Jan 2011
Location: Netherlands (Zuid Holland)
Distribution: Debian 8
Posts: 31

Rep: Reputation: 4
GhostScript resize paper size


I have pdf documents with a page size of 18 x 23 cm.
I want to have this resized to a4. I want the pages to be centred, but NOT scaled, so that I have larger margins to make annotations.

I have tried:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=$of $if

But it doesn't work.

I have also tried:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -sOutputFile=$of $if

This resizes the pages to 210x270 (which is not a4), and it scales the pages, which I don't want.

Anybody any idea how I can make it do what I want?
 
Old 03-13-2014, 02:38 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,280

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
I would go for Adobe's reader, as the printing options there are gui and very complete. You can very margins. Also tune this to work on one specific printer, as differ5ent pinters may give different results
 
Old 03-14-2014, 12:31 AM   #3
Axel van Moorsel
Member
 
Registered: Jan 2011
Location: Netherlands (Zuid Holland)
Distribution: Debian 8
Posts: 31

Original Poster
Rep: Reputation: 4
I am using a GUI at the moment, but I want to use scripting because it's fast and easy.

At the moment I use PDF writer under windows to do the job, because it keeps the file size small. In Linux you can print to file, but then the file size usually becomes more then 3 times as big.

GS seems a great tool, and it works if you use scaling. I think it must be possible to get what I want, I just don't know how.

I have tried your suggestion by using Adobe Reader 9 on Linux (Ubuntu 10), but then I cannot print to file, only to paper. I want to have it on file, because I use Xournal to annotate the pdf's.
 
Old 03-14-2014, 01:14 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,280

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
OK, then, I'd add margins. There must be a way
/ types furiously on console.. . . .

Look at gs_statd.ps, which I find in
/usr/share/ghostscript/9.05/Resource/Init

There's an 'a4small' paper size defined, i.e. a4 paper with a smaller image box. A little hacking on the image box should set you right. There's also 'lettersmall' and 'note'

Try them out.
 
  


Reply

Tags
ghostscript, pdf, 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
print A4-size pdfs to letter-size paper linuxqueric Linux - Newbie 2 09-30-2008 05:30 PM
LVM Resize - After logical resize, FS size does not match physical size. spectra Linux - Software 6 11-01-2006 12:28 PM
Ghostscript insists on a4 Paper statguy SUSE / openSUSE 6 09-14-2006 08:48 PM
Ghostscript: why is pdf size sometimes increased so much? J_Szucs Linux - Software 2 08-27-2004 10:19 AM
new paper size abs Slackware 1 02-07-2004 09:42 PM

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

All times are GMT -5. The time now is 10:21 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
Open Source Consulting | Domain Registration