Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Gs to split a pdf into multiple pages Post 302836503 by jossojjos on Wednesday 24th of July 2013 09:53:09 AM
Old 07-24-2013
Gs to split a pdf into multiple pages

Hello,

Some googling and checking the man pages told me it should be possible to split a pdf (or ps) file into individual pages :

Code:
man gs

You  might  want  to  print each page separately.  To do this, send the
       output to a series of files "foo1.xyz, foo2.xyz, ..." using the "-sOut-
       putFile=" switch with "%d" in a filename template:

            -sOutputFile=foo%d.xyz

So I tried splitting a file containing two pages :
Code:
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=un_nostop%d.pdf un_nostop.pdf

but only one file (un_nostop1.pdf) containing the two pages is created ...

I tried with other pdf files, and the result is always the same.

What's the problem ? It must be right there, but I can't see it ...

Thanks,
Jos
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Split text file by pages

Hello! Firts of all, I'm sorry for my English. My problem: I have text file with few Form Feed symbols (FF, ASCII code =12) inside (for example - some report, consists of some pages for printing). I want to split this text by pages - each page (until FF symbol) in single file. I... (2 Replies)
Discussion started by: ranri
2 Replies

2. Shell Programming and Scripting

how to get number of pages in a PDF file

Hello, Can anyone please help me providing script to get the number of pages in a PDF file? TIA Prvn (8 Replies)
Discussion started by: prvnrk
8 Replies

3. Shell Programming and Scripting

[Example] View man pages as pdf

This is a simple example of a shell script. I made it because it's sometimes convenient to search through a manpage and to have access to the terminal while you're reading (maybe to test code). It also serves as a basic example for anyone learning shell scripting. #!/bin/sh nm="/tmp/$1.pdf"... (0 Replies)
Discussion started by: CRGreathouse
0 Replies

4. UNIX for Advanced & Expert Users

creating pdf file with four pages

I have some code in fortran90, example stored in scode.f90 and I want to create a pdf containing the code. I would like to have four pages of code put into each page in the pdf. I was thinking of creating a ps file using mpage and then using ps2pdf after. However, I noticed that ps2pdf shift the... (4 Replies)
Discussion started by: kristinu
4 Replies

5. Shell Programming and Scripting

Split a text file into multiple pages based on pattern

Hi, I have a text file (attached the sample). I have also, attached the way the way the files need to be split. We get this file, that will either have 24 Jurisdictions, or will miss some and retain some. Like in the attached sample file, there are only Jurisdictions 03,11,14,15, 20 and 30.... (3 Replies)
Discussion started by: ebsus
3 Replies
PDFCLEAN(1)						      General Commands Manual						       PDFCLEAN(1)

NAME
pdfclean - pretty print, decompress and garbage collect PDF files SYNOPSIS
pdfclean [options] input.pdf [output.pdf] [pages] DESCRIPTION
pdfclean pretty prints and rewrites the contents of a PDF file. If no output file is specified, the new file will be written to "out.pdf" in the current directory. OPTIONS
-p password Use the specified password if the file is encrypted. -g Garbage collect objects that have no references from other objects. Give the option twice to renumber all objects and compact the cross reference table. Give it three times to merge and reuse duplicate objects. -d Decompress streams. This will make the output file larger, but provides easy access for reading and editing the contents with a text editor. pages Comma separated list of ranges to clean. SEE ALSO
mupdf(1), pdfdraw(1). pdfshow(1). AUTHOR
MuPDF was written by Tor Andersson <tor@ghostscript.com>. MuPDF is Copyright 2006-2010 Artifex Software, Inc. September 4, 2011 PDFCLEAN(1)
All times are GMT -4. The time now is 11:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy