From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47671 Path: news.gmane.org!not-for-mail From: John Devereux Newsgroups: gmane.comp.tex.context Subject: Re: Using texexec to prepare single-sided PDF for double-sided printing Date: Mon, 23 Feb 2009 19:47:29 +0000 Message-ID: <87hc2l7x66.fsf@cordelia.devereux.me.uk> References: <87zlge8qk5.fsf@cordelia.devereux.me.uk> <7596A83B-B6A0-446A-AE79-33E125FFC904@gmail.com> <87ocwt84q3.fsf@cordelia.devereux.me.uk> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235418569 13417 80.91.229.12 (23 Feb 2009 19:49:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2009 19:49:29 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 23 20:50:44 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1Lbgp5-0003Pu-J0 for gctc-ntg-context-518@m.gmane.org; Mon, 23 Feb 2009 20:50:39 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 21CCE1FC6B; Mon, 23 Feb 2009 20:49:15 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15646-03-12; Mon, 23 Feb 2009 20:48:14 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A70051FC67; Mon, 23 Feb 2009 20:48:14 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 966821FC67 for ; Mon, 23 Feb 2009 20:48:12 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15646-03-11 for ; Mon, 23 Feb 2009 20:47:37 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by ronja.ntg.nl (Postfix) with ESMTP id 1FD921FC36 for ; Mon, 23 Feb 2009 20:47:37 +0100 (CET) Original-Received: from cordelia.devereux.me.uk (cordelia.devereux.me.uk [217.169.15.178]) by filter4-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n1NJlVlw019590 for ; Mon, 23 Feb 2009 20:47:35 +0100 Original-Received: from [217.169.15.178] (helo=cordelia.devereux.me.uk ident=jd) by cordelia.devereux.me.uk with esmtp (Exim 4.69) (envelope-from ) id 1Lbgm1-0004p1-Nj for ntg-context@ntg.nl; Mon, 23 Feb 2009 19:47:29 +0000 In-Reply-To: (Wolfgang Schuster's message of "Mon\, 23 Feb 2009 18\:51\:09 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=217.169.15.178; country=GB; region=L6; city=Much Wenlock; latitude=52.6000; longitude=-2.5500; http://maps.google.com/maps?q=52.6000,-2.5500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 184126497 - cfea31da751e X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:47671 Archived-At: Wolfgang Schuster writes: > Am 23.02.2009 um 18:04 schrieb John Devereux: > >> Wolfgang Schuster writes: >> >>> Am 22.02.2009 um 16:00 schrieb John Devereux: >>> >>>> I would like to use texexec to post-process a large pdf file, so >>>> as to >>>> prepare it for double sided printing. The existing file has a large >>>> left hand "margin" on each page, so as to allow binding. >>>> >>>> I would like to change this so that odd (right) pages have a large >>>> left margin, and even (left) pages a large right margin. >>> >>> \setuppagenumbering[alternative=doublesided] >>> \setuplayout[horoffset=1cm] >>> \setuplayout[page] >>> \starttext >>> \copypages[document] >>> \stoptext >> >> Thanks, that's great! >> >> Is there an easy way to compensate for the original offset? The >> original pdf has a large left margin and a small right one. > > > Replace 'page' with the name of your document. > > \setuplayout[page] > > \starttext > > \getfiguredimensions[pages] > > \dorecurse\noffigurepages > {\hbox to \textwidth > {\ifodd\recurselevel > \hskip-2cm\externalfigure[pages][page=\recurselevel]\hss > \else > \hskip-1cm\externalfigure[pages][page=\recurselevel]\hss > \fi}} > > \stoptext Thanks Wolfgang, I got that to work perfectly. I had to fiddle around with it, I put the result on the Wiki (Please move/amend as appropriate) % replace "Manual" with the name of your original pdf \define\MySingleSidedDocument{Manual} % can adjust topspace to move page etc \setuplayout[\MySingleSidedDocument,topspace=1cm,header=0cm,backspace=0cm] % suppress page numbering \setuppagenumbering[location=] \starttext \getfiguredimensions[\MySingleSidedDocument] \dorecurse\noffigurepages {\hbox to \textwidth {\ifodd\recurselevel %adjust number to set odd page horizontal position \hskip-0.1cm\externalfigure[\MySingleSidedDocument][page=\recurselevel]\hss \else %adjust number to set even page horizontal position \hskip-1.8cm\externalfigure[\MySingleSidedDocument][page=\recurselevel]\hss \fi}} \stoptext -- John Devereux ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________