Sponsored Content
Top Forums Shell Programming and Scripting Script for converting a pdf to book format: an update Post 302458399 by aldebrn on Thursday 30th of September 2010 03:37:36 PM
Old 09-30-2010
Script for converting a pdf to book format: an update

With reference to [1], the script posted by dokan fails via a Bash syntax error because my version of pdftk 1.41 has multiple lines matching to "Num", which are stored in the TOTAL variable. If we modify the first non-ignored line of the script from
Code:
# Original
TOTAL=$( pdftk "$1" dump_data output | grep -i Num | cut -d \  -f2 )

to
Code:
# New
TOTAL=$( pdftk "$1" dump_data output | grep -i Number | cut -d \  -f2 )

the script works as expected.

However, its output isn't perfect. In inputting an eighteen page pdf and printing the output, I see that the middle two pages of the document (printed last) are not on the front-and-back of the last sheet, but are instead side-by-side on the same side of the sheet. Therefore, upon converting it to booklet form, instead of having an extra blank "sheet" (half-sheet) at the end of the document, I have two empty pages in the middle of it.

If this (minor but important) issue were fixed, this would be equivalent to printing "Booklet mode" from Acrobat Reader.

Thanks to dokan.

[1] https://www.unix.com/shell-programmin...ok-format.html

Last edited by aldebrn; 09-30-2010 at 04:40 PM.. Reason: forgot link
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

converting PDF to text, rtf doc format

Hi all Is there any program which can convert PDF to word processor file ? If the PDF has smart quotes, bullet icons, copyright and trademark symbols, etc. what happens to them intext format? So ideally would like to conver into rtf or doc. Thanks SS (1 Reply)
Discussion started by: saurya_s
1 Replies

2. Shell Programming and Scripting

Converting ps file to pdf

I have a number of post script files (*.ps) which I need to convert into Pdf. I am using the ps2pdf command for this, but the trouble is that this commands takes only one input at a time. So the command ps2pdf *.ps doesnt work. how can I make a script which will take each .ps file from... (3 Replies)
Discussion started by: jasjot31
3 Replies

3. AIX

AIX converting PDF to PS

my app creates pdf and prints them on windows. I want to run the same app on AIX 5.2. I convert PDF to PS using acroread command. But some options of acroread like landscape etc do not work. I came to know from google that there is bug with acroread for AIX with landscape option. Can you suggest... (3 Replies)
Discussion started by: vinayakshukre
3 Replies

4. UNIX for Dummies Questions & Answers

Converting multiple latex files to pdf

Hi everybody! This is my first post. I am a student and I'm familiarizing myself with linux. I have lots of directories each containing file called "zadaci.latex". I want to convert them to pdf's and rename them to <directory_name>.pdf. I read alot on this forum and came up with this script:... (2 Replies)
Discussion started by: Element9
2 Replies

5. UNIX for Dummies Questions & Answers

Converting LATEX PDF to WORD document

Hi there, is it possible to convert pdf files to Word with some free :p software or with some trick??? Now I'm working with LATEX and I can get pdf format but I would like to get .rtf or .doc files too:rolleyes:. Lately I found something like that, but it wasn't free. Thanks for any... (1 Reply)
Discussion started by: Giordano Bruno
1 Replies

6. Shell Programming and Scripting

Converting html to pdf perl

Hi All, I have a requirement of converting an html form into pdf using perl. The html form contains images, tables and css implementation. I tried using various perl modules but failed to achive the target. I succeeded in generating a pdf from the html file using... (2 Replies)
Discussion started by: DILEEP410
2 Replies

7. Shell Programming and Scripting

Script for converting a pdf to book format

Hello, excuse my English... I'm trying to do a nautilus-script to transform a normal A4 pdf to another pdf with book format, ready to be printed (double sided). I mean, the script put pages in order and also put 2 pages per horizontal A4 page (p.e.: a pdf with 8 pages would look like: 8-1, 2-7,... (2 Replies)
Discussion started by: dokan
2 Replies

8. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

9. Shell Programming and Scripting

Converting text files to xls through awk script for specific data format

Dear Friends, I am in urgent need for awk/sed/sh script for converting a specific data format (.txt) to .xls. The input is as follows: >gi|1234|ref| Query = 1 - 65, Target = 1677 - 1733 Score = 8.38, E = 0.6529, P = 0.0001513, GC = 46 fd sdfsdfsdfsdf fsdfdsfdfdfdfdfdf... (6 Replies)
Discussion started by: Amit1
6 Replies

10. Shell Programming and Scripting

Converting secured pdf files to pdf using acroread

Does anybody have idea of Converting secured pdf files to pdf using acroread ? ---------- Post updated at 04:49 PM ---------- Previous update was at 04:44 PM ---------- This file is not password protected. (4 Replies)
Discussion started by: Soham
4 Replies
CONTEXT(1)							      ConTeXt								CONTEXT(1)

NAME
context - front end to the new ConTeXt typesetting system SYNOPSIS
context [ OPTION ... ] FILE [ ... ] DESCRIPTION
context, a texlua(1) script, is the command-line front end to the new version of the ConTeXt typesetting system, an extensive macro package built on the tex(1) family of typesetting programs. context provides several facilties: o Process a ConTeXt source file, performing as many runs as necessary of luatex(1). Options control the output format, the pages to process, paper size, and so forth. o Create new ConTeXt formats, useful during installation. o Post-process existing PDF files, including merging multiple files, and extracting and rearranging pages within a file, similar to the facilities provided for PostScript files by psnup(1) or for PDF files by pdftk(1). OPTIONS
All switches should always be specified in full. With no options, context assumes that the file on the command line is a ConTeXt source file, i.e. a TeX file in the ConTeXt dialect, and produces a PDF file using the source file. --run process (one or more) files (default action) --make create context formats --ctx=name use ctx file (process management specification) --interface use specified user interface (default: en) --autopdf close pdf file in viewer and start pdf viewer afterwards --purge(all) purge files either or not after a run (--pattern=...) --usemodule=list load the given module or style, normally part o fthe distribution --environment=list load the given environment file first (document styles) --mode=list enable given the modes (conditional processing in styles) --path=list also consult the given paths when files are looked for --arguments=list set variables that can be consulted during a run (key/value pairs) --randomseed=number set the randomseed --result=name rename the resulting output to the given name --trackers=list set tracker variables (show list with --showtrackers) --directives=list set directive variables (show list with --showdirectives) --silent=list disable logcatgories (show list with --showlogcategories) --noconsole disable logging to the console (logfile only) --purgeresult purge result file before run --forcexml force xml stub (optional flag: --mkii) --forcecld force cld (context lua document) stub --arrange run extra imposition pass, given that the style sets up imposition --noarrange ignore imposition specifications in the style --once only run once (no multipass data file is produced) --batchmode run without stopping and don't show messages on the console --nonstopmode run without stopping --generate generate file database etc. (as mtxrun does) --paranoid don't descend to .. and ../.. --version report installed context version --expert show expert options INITIALIZATION
The context command is just a stub that runs the larger mtxrun script, which is a scripting framework written for texlua(1) that supports loading of extra modules, of which context is one. The implementation actually resides in a file named mtx-context.lua deep within the TDS structure. If context complains about Unknown script 'context', this can usually be fixed by executing mtxrun --generate on the command line: this command regenerates the database that mtxrun uses to find its extra modules. SEE ALSO
tex(1), luatex(1), texlua(1), psnup(1), pdftk(1). ConTeXt wiki <http://www.contextgarden.net>. ConTeXt mailing list home <http://www.ntg.nl/mailman/listinfo/ntg-context>. BUGS
This manpage is horribly incomplete. AUTHOR
This partial manpage was written by Taco Hoekwater <taco@metatex.org>. It is based on the --help output of context. context 0.52 June 2011 CONTEXT(1)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy