Go to file
2021-05-29 00:40:46 +05:30
docs Initial commit 2021-05-26 18:14:02 +05:30
src/pystitcher Add help for --cleanup 2021-05-29 00:32:56 +05:30
tests Move around test templates 2021-05-29 00:40:46 +05:30
.coveragerc Initial commit 2021-05-26 18:14:02 +05:30
.editorconfig Functionally running, but only for me 2021-05-26 19:24:36 +05:30
.gitignore Initial commit 2021-05-26 18:14:02 +05:30
.readthedocs.yml Initial commit 2021-05-26 18:14:02 +05:30
AUTHORS.rst Initial commit 2021-05-26 18:14:02 +05:30
CHANGELOG.rst [release] v1.0.0 2021-05-29 00:12:05 +05:30
LICENSE.txt Initial commit 2021-05-26 18:14:02 +05:30
pyproject.toml Initial commit 2021-05-26 18:14:02 +05:30
README.rst Move around test templates 2021-05-29 00:40:46 +05:30
setup.cfg remove comments from install_requires 2021-05-28 23:45:00 +05:30
setup.py Initial commit 2021-05-26 18:14:02 +05:30

==========
pystitcher
==========

pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a markdown file. It is written in pure python and uses `PyPDF3 <https://pypi.org/project/PyPDF3/>`_ for reading and writing PDF files.


Description
===========

pystitcher is a command line tool, with very few cli options::

	usage: pystitcher [-h] [--version] [-v] [--cleanup | --no-cleanup] spine.md output.pdf

	Stitch PDF files together

	positional arguments:
	  spine.md              Input markdown file
	  output.pdf            Output PDF file

	optional arguments:
	  -h, --help            show this help message and exit
	  --version             show program's version number and exit
	  -v, --verbose         log more things
	  --cleanup, --no-cleanup
	                        Delete temporary files (default: True)

Given this input::

	existing_bookmarks: remove
	title: Complete Guide to the Personal Data Protection Bill
	author: Medianama
	keywords: privacy, surveillance, personal data protection
	subject: Personal Data Protection Bill
	# A Complete Guide to the Personal Data Protection Bill

	- [Cover](cover.pdf)

	# The Bills

	- [Personal Data Protection Bill, 2019](1.a.pdf)
	- [Personal Data Protection Bill, 2018](1.b.pdf)

	# Other key reading material

	- [Srikrishna Committee Report](2.a.pdf)
	- [Dvara Research's Personal Data Protection Bill](2.b.pdf)
	- [MP Shashi Tharoor's Data Protection Bill](2.c.pdf)
	- [MP Jay Panda's Data Protection Bill](2.d.pdf)
	- [SaveOurPrivacy.in bill](2.e.pdf)
	- [TRAI recommendations on privacy](2.f1.pdf)
	- [Comments on TRAI recommendations on privacy](2.f2.pdf)

Will generate a PDF with proper bookmarks:

.. image:: https://i.imgur.com/qPVpZGt.png

And the correct metadata::

	Title:          Complete Guide to the Personal Data Protection Bill
	Subject:        Personal Data Protection Bill
	Keywords:       privacy, surveillance, personal data protection
	Author:         Medianama
	Creator:        pystitcher/1.0.0
	Producer:       pystitcher/1.0.0

Configuration options can be specified with Meta data at the top of the file.

+---------------------+--------------------------------------------------------------------------+
| Option              | Notes                                                                    |
+=====================+==========================================================================+
| fit                 | Default fit of the bookmark. Can be overwritten per bookmark             |
|                     | See `wiki <https://github.com/captn3m0/pystitcher/wiki/Zoom-Levels>`_    |
|                     | for more details.                                                        |
+---------------------+--------------------------------------------------------------------------+
| author              | PDF Author                                                               |
+---------------------+--------------------------------------------------------------------------+
| keywords            | PDF Keywords                                                             |
+---------------------+--------------------------------------------------------------------------+
| subject             | PDF Subject                                                              |
+---------------------+--------------------------------------------------------------------------+
| title               | PDF Title. If left unspecified, first Heading (h1)                       |
|                     | in the document is used.                                                 |
+---------------------+--------------------------------------------------------------------------+
| existing_bookmarks  | What to do with existing bookmarks in individual files.                  |
|                     | Options are ``keep``, ``flatten``, and ``remove``. See                   |
|                     | `docs <https://github.com/captn3m0/pystitcher/wiki/Existing-Bookmarks>`_ |
|                     | for more details.                                                        |
+---------------------+--------------------------------------------------------------------------+