Re: [NTG-context] doublesided PDF - first and last page singlesided
I was lucky to get a fast answer - but with your code I don't get the right result: -- start your code \startmode[booklet] \setuppapersize[A5][A4,landscape] \setuparranging[2SIDE] \stopmode \starttext First page \startmode[booklet] \null \page \stopmode etc. \stoptext Thomas -- stop With your code I get: 1 2 first page of the pdf 3 4 second 5 6 third 7 8 fourth But I want to get: 1 first page of the pdf (coverpage) 2 3 second 4 5 third 6 7 fourth 8 fifth (coverpage) I know how to use with modes - but the answer must be an other. Maybe I have to explain it more clearly: on the first PDF-Page (A5) there should be only the cover-page (page 1) \setuppapersize[A5][A5] \setuparranging[1SIDE]%<- I don't know how to write it - nothing was working On the second PDF-Page there should be page 2 and page 3 \setuppapersize[A5][A4,landscape] \setuparranging[2SIDE] It must be a problem lot's of people have when they make a book with ConTeXt and want to make a second PDF-version for the Internet. Regards Jannis -- Better organization and integration of all ConTeXT-information: http://wiki.contextgarden.net/Category:ConTeXt ............ All information arround ConTeXt http://wiki.contextgarden.net/Category:Commands ........ Commands !!! new: "One-Click" from every command in the wiki to the rich resources of the ConTeXt-mailinglist
On Mon, 16 Apr 2012, Jan Heinen wrote:
I was lucky to get a fast answer - but with your code I don't get the right result:
-- start your code
\startmode[booklet] \setuppapersize[A5][A4,landscape] \setuparranging[2SIDE] \stopmode \starttext First page \startmode[booklet] \null \page \stopmode etc. \stoptext
Thomas
-- stop
With your code I get:
1 2 first page of the pdf 3 4 second 5 6 third 7 8 fourth
But I want to get:
1 first page of the pdf (coverpage) 2 3 second 4 5 third 6 7 fourth 8 fifth (coverpage)
I know how to use with modes - but the answer must be an other.
Maybe I have to explain it more clearly:
on the first PDF-Page (A5) there should be only the cover-page (page 1) \setuppapersize[A5][A5]
\setuparranging[1SIDE]%<- I don't know how to write it - nothing was working
On the second PDF-Page there should be page 2 and page 3 \setuppapersize[A5][A4,landscape]
\setuparranging[2SIDE]
It must be a problem lot's of people have when they make a book with ConTeXt and want to make a second PDF-version for the Internet.
If you don't mind creating another file to convert a given double sided pdf into the above format, you can use the following (pseudo code, untested, and might have typos) get number of pages in the pdf \getfiguredimensions[filename] \edef\NOfPages{\noffigurepages} insert the first page \startTEXpage[height=(A5 height}, width=(A5 width)] \externalfigure[filename][page=1] \stopTEXpage loop and insert all but the last page (you may have to test if the number of pages are odd or even and use \numexpr(\NOfPages - 1) to find the last but one page: \dostepwiserecurse{2}{2}{\LastButOnePage} { \startTEXpage[height=(A5 height), width=(A4 height)] \expanded{\externalfigure[filename][page=\recurselevel]}% \expanded{\externalfigure[filename][page=\numexpr\recurselevel+1\relax]}% \stopTEXpage } If the number of pages is even, insert last page. Aditya
On Sun, 15 Apr 2012, Aditya Mahajan wrote:
If you don't mind creating another file to convert a given double sided pdf into the above format, you can use the following (pseudo code, untested, and might have typos)
You can also create a mtx-context-doublesided.lua script that takes the filename from command line and does all the processing at the lua level. See mtx-context-*.lua in $TEXMF/tex/context/base/ for examples. Aditya
On 04/16/2012 12:17 AM, Jan Heinen wrote:
I was lucky to get a fast answer - but with your code I don't get the right result:
-- start your code
\startmode[booklet] \setuppapersize[A5][A4,landscape] \setuparranging[2SIDE] \stopmode \starttext First page \startmode[booklet] \null \page \stopmode etc. \stoptext
Thomas
-- stop
With your code I get:
1 2 first page of the pdf 3 4 second 5 6 third 7 8 fourth
But I want to get:
1 first page of the pdf (coverpage) 2 3 second 4 5 third 6 7 fourth 8 fifth (coverpage)
I know how to use with modes - but the answer must be an other.
No, I get the result you want with my code. \startmode[booklet] \setuppapersize[A5][A4,landscape] \setuparranging[2SIDE] \stopmode \starttext One \page \startmode[booklet] \null \page \stopmode Two \page Three \page Four \page Five \page Six \page Seven \page Eight \stoptext You should make an example yourself, I'm still guessing what it is you want to achieve. I'm not sure what a "pdf-version for the internet" is - pdf is not a web-based format? Thomas
On Mon, 16 Apr 2012, Thomas A. Schmitz wrote:
You should make an example yourself, I'm still guessing what it is you want to achieve. I'm not sure what a "pdf-version for the internet" is - pdf is not a web-based format?
My guess is that that OP wants to display the pdf the same way Acrobat reader displays a pdf in double-sided document in "two up" mode. For example, open any of the ConTeXt "This Way" magazines in two-up mode. Aditya
On 04/16/2012 08:48 AM, Aditya Mahajan wrote:
You should make an example yourself, I'm still guessing what it is you want to achieve. I'm not sure what a "pdf-version for the internet" is - pdf is not a web-based format?
My guess is that that OP wants to display the pdf the same way Acrobat reader displays a pdf in double-sided document in "two up" mode. For example, open any of the ConTeXt "This Way" magazines in two-up mode.
Ah OK, I see what you mean. But isn't that dependent on which pdf viewer you use to view the file? Even more so when you view it from within a browser which may or may not have a plugin for displaying pdf? Thomas
participants (3)
-
Aditya Mahajan
-
Jan Heinen
-
Thomas A. Schmitz