Home > ubuntu > How to split a PDF onto multiple pages on command line?

How to split a PDF onto multiple pages on command line?

June 15Hits:0

How can I split (tile?) one huge PDF onto multiple pages? The result can be one PDF with multiple A4 pages or several A4 PDFs.

Although I generated the PDF with dot I would like to have this problem solved in general -- or at least on a standard Ubuntu (eg. 12.04).

The input PDF has been generated by Graphviz dot, eg. dot -Tpdf sample.dot > sample.pdf. When I did not add a size="8,11"; ratio="fill"; to the graph the output PDF is very large. If I add the size/fill-hints dot only scaled things down for me.

Lets give you one example:

If my original PDF was huge like this:

+-------------------+ |                   | |  O                | |  :                | |  :..........C     | |  :        :       | |  :        :       | |  :        :       | |  :        G       | |  :        :       | |  :        :       | |  :        :       | |  :        :       | |  U        :       | |           B       | |                   | +-------------------+ 

This should be split by a command like

pdftile sample.pdf -x 2 -y 3 > sample-2x3.pdf 


+---------+---------+ |         |         | |  O      |         | |  :      |         | |  :......|...C     | |  :      | :       | +---------+---------+ |  :      | :       | |  :      | :       | |  :      | G       | |  :      | :       | |  :      | :       | +---------+---------+ |  :      | :       | |  :      | :       | |  U      | :       | |         | B       | |         |         | +---------+---------+ 

I looked into the pdfjam toolset but it seems this feature is not implemented there. I would like it to be a command line tool -- and it should be automated, not manually


It looks like pdfposter can do this.

Several linux utilities come to mind:

(from their man pages)

pdfseperate [options] INPUT.PDF OUTPUT%d.PDF

reads INPUT.PDF, extracts one or more pages, and writes one PDF file for each page to OUTPUT%d.PDF (%d is placeholder for page number) (from 'poppler-utils' package)

pdftk INPUT.PDF burst

reads INPUT.PDF, producing one or more PDF files containing individual pages, named 'pg-XXXX.pdf' (unless output filename specified) (from 'pdftk' package)

Take a look on http://www.graphviz.org/doc/FAQ.html: Q14. How can I print a big graph on multiple pages?

The page attribute, if set, tells Graphviz to print the graph as an array of pages of the given size. Thus, the graph

digraph G { page="8.5,11"; ... }

will be emitted as 8.5 by 11 inch pages. When printed, the pages can be tiled to make a drawing of the entire graph. At present, the feature only works with PostScript output. Alternatively, there are various tools and viewers which will take a large picture and allow you to extract page-size pieces, which can then be printed.

ONLY Postscript! But for automation no showstopper :-). Just let ps2pdf run over it. It worked for me.

Related Articles

  • How to split a PDF onto multiple pages on command line?June 15

    How can I split (tile?) one huge PDF onto multiple pages? The result can be one PDF with multiple A4 pages or several A4 PDFs. Although I generated the PDF with dot I would like to have this problem solved in general -- or at least on a standard Ubun

  • Programmatically Split A Post Into Multiple PagesDecember 23

    We all know that when you're creating a standard post in WordPress you can split the post into multiple pages by adding this code into the text body: <!--nextpage--> Is it possible to split a post up like this programatically? I have a gallery custo

  • PDF to TEXT open source command line toolJune 8

    PDF to TEXT open source command line tool ? It must be Command line utility & should be open source, free to use. --------------Solutions------------- Personally, I use PDFMiner for Python (>= 2.6). It's simple enough, and it has always seemed to w

  • Split a single page PDF into multiple pagesApril 18

    Is there an easy way (in Preview or whatever) to scale up and split a PDF file with a single page into multiple pages? What I would like is to split say an A3 paper document into two A4 pages, to print separately and then put together with tape. How

  • Linux-based tool to chop PDFs into multiple pagesSeptember 22

    I've got a bunch of PDF files that have been produced two "real" pages to a single PDF page; I'd like to chop these in half and put each half on a separate page. Essentially, I need something thatdoes the exact opposite of pdfnup (or psnup). Goo

  • Split landscape PDF into portrait pages

    Split landscape PDF into portrait pagesMay 18

    I am given a couple PDF files which are created using LaTeX in a landscape format. On my 24" monitor, I can comfortably read them full screen, but it is a pain to use when the windows is smaller, like on my Netbook. Is there some way to split this PD

  • Prev and Next link for splitting single post into multiple pages August 6

    This question already has an answer here: Paged posts - how to use numbers and next/previous links? 6 answers I have pagination on my site like this: Pages 1 2 3 4 - and so on. I am doing this by adding <--nextpage--> where i want to split my long p

  • Split blog posts over multiple pagesSeptember 22

    Apologies in advance for the long message but I am very new to Drupal and really have no idea what I'm doing sowill try to explain. My company has there website built in Drupal 7, we have a module installed which allows us to create single page blogs

  • Using long table to split a table across multiple pages

    Using long table to split a table across multiple pagesMay 21

    I am using the excel to latex add in to generate tables from excel, however, when the table is too long it is not split automatically between 2 (or more pages). Is there any easy way to do this? I have found the longtable package, however, I am not m

  • iText Links in the PDF with multiple pages based on the text searchFebruary 4

    How to put link in an already well formed PDF on a specific position on the first page (lets say some position at top left corner) but the target needs to be found out based on a text search in the PDF. For instance, PDF has 10 pages, need to create

  • Convert a PDF to greyscale on the command line in FLOSS?February 4

    I have a colour PDF file, and I'm going to print it out and then photocopy it in black and white. I'd like to know what it's like in B&W before photocopying it. Is it possible to 'greyscale' a PDF on the command line using free software? I'm using Ub

  • How do I convert a DjVu document to PDF in Linux using only command line tools?January 26

    I've got some documents in DjVu which I'll like convert to PDF. Is there a way to do this using command line OSS tools? --------------Solutions------------- djvu2pdf should fit the bill, it's a small script that makes use of the djvulibre toolset. If

  • Check if PDF files are corrupted using command line on LinuxApril 10

    I have many PDF files on one folder. Is it possible check if one or more files are corrupted (zero pages, or unfinished downloads) using the command line, without needing to open them one by one? --------------Solutions------------- Perhaps running p

  • Accessing HTML pages through command line for scripting April 14

    I have some "corporative" systems I have to use at work. Some of them are terrible, with frames, pop-ups and such. I was thinking about automating some stuff using curl or something like that. I need login, click on hyperlinks, set some data, an

  • How to change extension of multiple files from command line?April 19

    I have many files with .abc extension and want to change them to .edefg How to do this from command line ? EDIT: I have a root folder with many sub-folders, so the solution should work -r recursively. --------------Solutions------------- A portable w

  • How to generate jpg thumbnails and browsable html pages from command line?May 12

    I am searching for a simple command line tool that takes a bunch of jpg files as input, copies them to some destination and generates some browsable html for it (including index page, preview thumbnails etc.), such that I can upload the results to so

  • How do I convert an HTML email saved as a text file to a PDF file from the Linux command line? August 23

    I need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images. Are there any Linux tools that will allow me to do this from the command line (so it can be scri

  • split a large file with mac in command line by contextFebruary 10

    I have been trying to split a large file (some GB) into pieces, I need to chunk the file by linenumber (say, containings about 1M lines each). How could I do? csplit does not work, goes out of memory. Below, an example of the content: 690451 World_Wa

  • "wput" multiple files from command line?May 2

    You can upload a single file with wput: wput file ftp://username:[email protected]/file is there a way to upload multiple? Maybe something like: wput {file1,file2} ftp://username:[email protected]/{file1,file2} Note: I know there are solutions using ft

  • restricting printing, editing and converting of pdf documents converted by libreoffice command line toolJuly 7

    I am trying to convert files to pdf using the libreoffice command line tool like this - libreoffice --headless --convert-to pdf filename Now I want to restrict the printing, editing and converting of the converted file, how do i achieve that on the c

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.812 s.