Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jekyll-pandoc-multiple-formats
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edsl
jekyll-pandoc-multiple-formats
Commits
5959ddb1
Commit
5959ddb1
authored
11 years ago
by
fauno
Browse files
Options
Downloads
Patches
Plain Diff
Automatic page imposition of PDFs
parent
6c620122
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/imponer
+8
-3
8 additions, 3 deletions
bin/imponer
with
8 additions
and
3 deletions
bin/imponer
+
8
−
3
View file @
5959ddb1
...
...
@@ -3,6 +3,11 @@
file
=
ARGV
.
first
exit
if
not
File
.
exist?
file
# Los temporales tiene un sufijo -tmp
file_tmp
=
file
.
gsub
(
/\.pdf$/
,
'-tmp.pdf'
)
# Los definitivos -tmp-imposed
file_imp
=
file
.
gsub
(
/\.pdf$/
,
'-tmp-imposed.pdf'
)
# Cantidad de páginas
pages
=
`pdfinfo '
#{
file
}
' | grep '^Pages:' | cut -d: -f2 | tr -d ' '`
.
to_i
...
...
@@ -28,7 +33,7 @@ pages8 = ((pages4/2+3)/4*4).to_i
--suffix imposed \
--no-landscape \
--signature
#{
pages8
}
\
"
#{
file
.
gsub
/\.pdf$/
,
'-tmp.pdf'
}
"`
"
#{
file
_tmp
}
"`
`rm "
#{
file
.
gsub
/\.pdf$/
,
'-tmp.pdf'
}
"`
`mv "
#{
file
.
gsub
/\.pdf$/
,
'-tmp-imposed.pdf'
}
" "
#{
file
.
gsub
/-tmp/
,
''
}
"`
`rm
-v
"
#{
file
_tmp
}
"`
`mv
-v
"
#{
file
_imp
}
" "
#{
file
_imp
.
gsub
/-tmp/
,
''
}
"`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment