LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-16-2007, 09:49 AM   #1
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Rep: Reputation: 15
editing .pdf files.


IS there a way to take the first page of several PDF files and put them in one PDF file?
 
Old 09-16-2007, 09:56 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Surely is, but there are threads about "editing PDF files" already so be kind and search+read them first..

PDF files are not actually meant to be "edited", even though there are apps that can do things for them. Better get the originals, which you should have access to anyway if you are permitted to use them (and if you aren't, you shouldn't be asking), edit them and re-export to new PDF file(s). You can read more about PDF on the net, like in Wikipedia for example, to understand why it's not supposed to be edited like some Word document..

Note that there probably isn't any tool around that can do 100% clean job. Each one I've tried messes something up, most of the time I just get lucky and it's not visible in the output. The best way around is to simply get your hands on the originals and edit them..

EDIT: probably the most legal way you can do this is buy an expensive licence for Adobe Acrobat's newest version; I recall some version of it was able to do things like this. But like I said, if you don't have the originals for the PDF, you probably aren't the legal owner of the work, which means most of the time that you aren't - according to copyright laws - supposed to be editing the file, so..

Last edited by b0uncer; 09-16-2007 at 09:58 AM.
 
Old 09-16-2007, 10:05 AM   #3
iAlta
Member
 
Registered: Oct 2005
Distribution: Ubuntu 7.10, OpenSUSE 10.3, Linux Mint, Arch
Posts: 92

Original Poster
Rep: Reputation: 15
I was think about taking the first page of the Vista ELUA* from different languages and put them in one PDF file, for convenience of printing, instead of just printing the first page of each file.
I defeneetly don't have copyright on that...

* Where is says retailers have to refund the cost of the OS if you don't accept the agreement(which I don't).

Last edited by iAlta; 09-16-2007 at 10:30 AM. Reason: typo
 
Old 09-16-2007, 02:07 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by iAlta View Post
IS there a way to take the first page of several PDF files and put them in one PDF file?
Yes, this should be easy to do with Ghostscript. For example,
Code:
#!/bin/sh
# takes as arguments a bunch of pdf files
# produces as output the value of the environment variable OUTPUT
# if no such variable exists, then “outfile.pdf” is used

if [ -z "${OUTPUT}" ]
then
	OUTPUT="outfile.pdf"
fi

TEMP=$(mktemp -d)
count=1

for file in $@
do
	gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=1 -dLastPage=1 -sOutputFile="${TEMP}/${count}.pdf" "${file}"
	count=$(expr $count + 1)
done

cd ${TEMP}

gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${OLDPWD}/${OUTPUT}" $(ls | sort -n)

cd ${OLDPWD}
rm -rf ${TEMP}

Last edited by osor; 09-16-2007 at 02:11 PM. Reason: typo
 
  


Reply



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
Editing .PDF or .(E)PS files in Linux? 95se Linux - Software 13 02-08-2006 09:33 PM
editing PDF files linuxhippy Linux - Software 2 12-05-2004 02:18 PM
Editing PDF Files in Linux jomy Linux - Software 1 11-21-2004 07:28 AM
Editing PDF files darin3200 Linux - General 2 06-30-2003 07:20 PM

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

All times are GMT -5. The time now is 04:21 AM.

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