pdftools.pdfposter-0.6.0/ 0000755 0001750 0001750 00000000000 12146756351 016560 5 ustar hartmut hartmut 0000000 0000000 pdftools.pdfposter-0.6.0/setup.py 0000644 0001750 0001750 00000011574 12146742651 020300 0 ustar hartmut hartmut 0000000 0000000 """
``Pdfposter`` can be used to create a large poster by building it from
multple pages and/or printing it on large media. It expects as input a
PDF file, normally printing on a single page. The output is again a
PDF file, maybe containing multiple pages together building the
poster.
The input page will be scaled to obtain the desired size.
This is much like ``poster`` does for Postscript files, but working
with PDF. Since sometimes poster does not like your files converted
from PDF. :-) Indeed ``pdfposter`` was inspired by ``poster``.
For more information please refere to the manpage or visit
the `project homepage `_.
"""
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
additional_keywords ={}
try:
import py2exe
except ImportError:
py2exe = None
from distutils.core import Command
from distutils import log
import os
class build_docs(Command):
description = "build documentation from rst-files"
user_options=[]
def initialize_options (self): pass
def finalize_options (self):
self.docpages = DOCPAGES
def run(self):
substitutions = ('.. |VERSION| replace:: '
+ self.distribution.get_version())
for writer, rstfilename, outfilename in self.docpages:
distutils.dir_util.mkpath(os.path.dirname(outfilename))
log.info("creating %s page %s", writer, outfilename)
if not self.dry_run:
try:
rsttext = open(rstfilename).read()
except IOError, e:
sys.exit(e)
rsttext = '\n'.join((substitutions, rsttext))
# docutils.core does not offer easy reading from a
# string into a file, so we need to do it ourself :-(
doc = docutils.core.publish_string(source=rsttext,
source_path=rstfilename,
writer_name=writer)
try:
rsttext = open(outfilename, 'w').write(doc)
except IOError, e:
sys.exit(e)
cmdclass = {}
try:
import docutils.core
import docutils.io
import docutils.writers.manpage
import distutils.command.build
distutils.command.build.build.sub_commands.append(('build_docs', None))
cmdclass['build_docs'] = build_docs
except ImportError:
log.warn("docutils not installed, can not build man pages. "
"Using pre-build ones.")
DOCPAGES = (
('manpage', 'pdfposter.rst', 'docs/pdfposter.1'),
('html', 'pdfposter.rst', 'docs/pdfposter.html'),
)
if py2exe:
resources = {
#'other_resources': [(u"VERSIONTAG",1,myrevisionstring)],
'icon_resources' : [(1,'projectlogo.ico')]
}
additional_keywords.update({
'windows': [],
'console': [dict(script='pdfposter', **resources)],
'zipfile': None,
})
setup(
cmdclass=cmdclass,
name = "pdftools.pdfposter",
version = "0.6.0",
#scripts = ['pdfposter'],
install_requires = ['pyPdf>1.10'],
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['pdftools'],
package_data = {
# If any package contains *.txt or *.rst files, include them:
'': ['*.txt', '*.rst'],
# And include any *.msg files found in the 'hello' package, too:
'hello': ['*.msg'],
},
# metadata for upload to PyPI
author = "Hartmut Goebel",
author_email = "h.goebel@crazy-compilers.com",
description = "Scale and tile PDF images/pages to print on multiple pages.",
long_description = __doc__,
license = "GPL 3.0",
keywords = "pdf poster",
url = "http://pythonhosted.org/pdftools.pdfposter/",
download_url = "http://pypi.python.org/pypi/pdftools.pdfposter/",
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Printing',
'Topic :: Utilities',
],
# these are for easy_install (used by bdist_*)
zip_safe = True,
entry_points = {
"console_scripts": [
"pdfposter = pdftools.pdfposter.cmd:run",
],
},
# these are for py2exe
options = {
# bundle_files 1: bundle everything, including the Python interpreter
# bundle_files 2: bundle everything but the Python interpreter
# bundle_files 3: don't bundle
"py2exe":{"optimize": 2,
"bundle_files": 1,
"includes": [],
}
},
**additional_keywords
)
pdftools.pdfposter-0.6.0/setup.cfg 0000644 0001750 0001750 00000000614 12146756351 020402 0 ustar hartmut hartmut 0000000 0000000 [sdist]
formats = bztar,zip
[bdist]
formats = egg
[aliases]
home = develop --install-dir ~/lib/python/ --script-dir ~/bin
devel = develop --multi-version --install-dir bin
daily = egg_info --tag-svn-revision --tag-build=dev bdist sdist
release = egg_info sdist register upload upload_docs
[upload_docs]
upload-dir = docs/_build/html
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
pdftools.pdfposter-0.6.0/pdfposter.rst 0000644 0001750 0001750 00000015400 12146743456 021322 0 ustar hartmut hartmut 0000000 0000000 .. -*- mode: rst ; ispell-local-dictionary: "american" -*-
==========================
pdfposter
==========================
-------------------------------------------------------------
Scale and tile PDF images/pages to print on multiple pages.
-------------------------------------------------------------
:Author: Hartmut Goebel
:Version: Version |VERSION|
:Copyright: 2008-2013 by Hartmut Goebel
:Licence: GNU Public Licence v3 (GPLv3)
:Manual section: 1
.. raw:: manpage
.\" disable justification (adjust text to left margin only)
.ad l
SYNOPSIS
==========
``pdfposter`` infile outfile
DESCRIPTION
============
``Pdfposter`` can be used to create a large poster by building it from
multple pages and/or printing it on large media. It expects as input a
PDF file, normally printing on a single page. The output is again a
PDF file, maybe containing multiple pages together building the
poster.
The input page will be scaled to obtain the desired size.
.. comment
The output pages bear cutmarks and have slightly overlapping
images for easier assembling.
The program uses a simple but efficient method which is possible with
PDF: All new pages share the same data stream of the scaled page. Thus
resulting file grows moderatly.
To control its operation, you need to specify either the size of the
desired poster or a scale factor for the image:
- Given the poster size, it calculates the required number of sheets
to print on, and from that a scale factor to fill these sheets
optimally with the input image.
- Given a scale factor, it derives the required number of pages from
the input image size, and positions the scaled image centered on
this area.
OPTIONS
========
General Options
--------------------
--version Show program's version number and exit
-h, --help Show help message and exit
--help-media-names List available media and distance names and exit
-v, --verbose Be verbose. Tell about scaling, rotation and number of
pages. Can be used more than once to increase the
verbosity.
-n, --dry-run Show what would have been done, but do not generate files.
-A, --art-box Use the content area defined by the ArtBox (default:
use the area defined by the TrimBox)
Defining Output
-----------------
-m BOX, --media-size=BOX Specify the desired media size to print on.
See below for *BOX*. The default is A4 in the standard
package.
-p BOX, --poster-size=BOX Specify the poster size. See below for *BOX*.
pdfposter will autonomously choose scaling and rotation to
best fit the input onto the poster (see EXAMPLES below).
If you give neither the *-s* nor the *-p* option, the default
poster size is identical to the media size.
-s NUMBER Specify a linear scaling factor to produce the poster.
Together with the input image size and optional margins,
this induces an output poster size. So don't specify both *-s*
and *-p*.
Default is deriving the scale factor to fit a given poster
size.
Box Definition
-----------------
The *BOX* mentioned above is a specification of horizontal and
vertical size. The syntax is as follows (with multipier being
specified optionally):
*box* = [ *multiplier* ] *unit*
*multiplier* = *number* "x" *number*
*unit* = *medianame* or *distancename*
..
Only in combination with the *-i* option, the program
also understands the offset specification in the *BOX*.
= +,
[]
and offset
Many international media names are recognised by the program, in upper
and lower case, and can be shortened to their first few characters, as
long as unique. For instance 'A0', 'Let'. Distance names are like
'cm', 'inch', 'ft'.
Medias are typically not quadratic but rectangular, which means width
and hight differ. Thus using medianames is a bit tricky:
:10x20cm: obviuos: 10 cm x 20 cm (portrait)
:20x10cm: same as 10x20cm, since all boxes are rotated to portrait
format
Now when using medianames it gets tricky:
:1x1a4: same as approx. 21x29cm (21 cm x 29 cm, portrait)
:1x2a4: same as approx. 21x58cm (21 cm x 58 cm, portrait)
This are two a4 pages put together at the *small* side: One
portrait page wide and two portrait pages high.
:2x1a4: same as approx. 42x29cm, which is rotated to portrait and is
the same a 29x42cm (29 cm x 42 cm)
This are two a4 pages put together at the *long* side: Two
portrait pages wide and one portrait page high.
EXAMPLES
============
:pdfposter -mA3 -pA0 a4.pdf out.pdf:
Prints an A4 input file on 8 A3 pages, forming an A0 poster.
:pdfposter -p3x3Let a4.pdf out.pdf:
Prints an inputfile on a poster of 3x3 Letter pages.
..
not yet implemented: margins
:pdfposter -mA0 -w2x2i input.pdf out.pdf:
Enlarges an inputfile to print on a large-media A0 capable
device, maintaining 2 inch margins:
:pdfposter -mA0 input.pdf out.pdf:
Enlarges an inputfile to print on a large-media A0 capable
device.
:pdfposter -s4 input.pdf out.pdf:
Enlarge an inputfile exactly 4 times, print on the default A4
media, and let ``pdfposter`` determine the number of pages
required.
..
not yet implemented
:pdfposter -mLegal -p1x1m -w10% -C5 input.pdf out.pdf:
Scale a postscript image to a poster of about 1 square meter,
printing on 'Legal' media, maintaining a 10% of 'Legal' size
as white margin around the poster. Print cutmark lines and grid
labels, but don't print cut mark arrow heads.
:pdfposter -m10x10cm -pa0 a4.pdf out.pdf:
Just to show how efficient ``pdfposter`` is: This will create a file
containing 192 pages, but only 15 times as big as the single page.
With a4.pdf being a quite empty page, this ratio should be even
better for filled pages.
More examples including sample pictures can be found at
http://pythonhosted.org/pdftools.pdfposter/examples
Examples for automatic scaling
------------------------------------
* For printing 2 *portrait* A4 pages high (approx. 58cm) and let
pdfposter determine how many portrait pages wide, specify a lage
number of *vertical* pages. eg:
:pdfposter -p999x2a4 testpage-wide.pdf out.pdf:
* For printing 2 *landscape* A4 pages high (approx. 20cm) and let
pdfposter determine how many landscape pages wide, specify a lage
number of *horizontal* pages. eg:
:pdfposter -p2x999a4 testpage-wide.pdf out.pdf:
SEE ALSO
=============
``poster``\(1),
``pdfnup``\(1) http://pypi.python.org/pypi/pdfnup/,
``pdfsplit``\(1) http://pypi.python.org/pypi/pdfsplit/,
``pdfgrid``\(1) http://pypi.python.org/pypi/pdfgrid/
Project Homepage http://pythonhosted.org/pdftools.pdfposter/
pdftools.pdfposter-0.6.0/docs/ 0000755 0001750 0001750 00000000000 12146756351 017510 5 ustar hartmut hartmut 0000000 0000000 pdftools.pdfposter-0.6.0/docs/images/ 0000755 0001750 0001750 00000000000 12146756351 020755 5 ustar hartmut hartmut 0000000 0000000 pdftools.pdfposter-0.6.0/docs/images/testpage-wide.preview.png 0000644 0001750 0001750 00000072532 11761521616 025712 0 ustar hartmut hartmut 0000000 0000000 PNG
IHDR l IDATxwxUU?M$n ;*bÂE2b_PGgFQ MBz!{o}.'OeZ{ާ """ ~H"iSnɔhS?Sx*Je_
[l?_+5gfdTqc8%"◊'5UMd[ztZM|"q2nFŧG##h\ܔ^ey*7}Xu]<_ >
!P_Uf"-fGd̊t1],Mp)6]D.a3=X`*'x)p,6_S=QPƫ| wJ.PQeT?yLRTx::Y*"NV/KUdUdu