From owner-freebsd-questions@FreeBSD.ORG Mon Jan 26 00:30:01 2009 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 045DF1065673 for ; Mon, 26 Jan 2009 00:30:01 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 05DF38FC1A for ; Mon, 26 Jan 2009 00:29:59 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from phenom.cordula.ws (phenom [192.168.254.60]) by fw.farid-hajji.net (Postfix) with ESMTP id 5DB0F32D58; Mon, 26 Jan 2009 01:29:57 +0100 (CET) Date: Mon, 26 Jan 2009 01:30:42 +0100 From: cpghost To: Gary Kline Message-ID: <20090126003042.GA5314@phenom.cordula.ws> References: <20090126001822.GA38314@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090126001822.GA38314@thought.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: FreeBSD Mailing List Subject: Re: can i split a pdf file? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2009 00:30:01 -0000 On Sun, Jan 25, 2009 at 04:18:26PM -0800, Gary Kline wrote: > Folks, > > Is there a way to split a large pdf file into smaller [ say 1MB ] > chunks? Or are there open source tools out there that i can > build? > > thanks in advance, > > gary To split the file, use split(1): $ split -b 1M file.pdf file-chunk See "man split". But you won't be able to view the chunks separately, because, well, they aren't PDF files anymore. ;-) For this, you'd prefer to split the PDF file after N pages. You may want to investigate print/pdftk: >From /usr/ports/print/pdftk/pkg-descr: If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Keep one in the top drawer of your desktop and use it to: Merge PDF Documents Split PDF Pages into a New Document Decrypt Input as Necessary (Password Required) Encrypt Output as Desired Burst a PDF Document into Single Pages Report on PDF Metrics, including Metadata and Bookmarks Uncompress and Re-Compress Page Streams Repair Corrupted PDF (Where Possible) Pdftk is also an example of how to use a library of Java classes in a stand-alone C++ program. Specifically, it demonstrates how GCJ and CNI allow C++ code to use iText's (itext-paulo) Java classes. WWW: http://www.accesspdf.com/pdftk/ There are also other less heavy-weight programs to extract pages and page-ranges from a PDF and PostScript file... -cpghost. -- Cordula's Web. http://www.cordula.ws/