{ "info": { "author": "GHPen", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pdfoutliner\nCommand line tool for generating [`pdftk`-style](https://www.pdflabs.com/blog/export-and-import-pdf-bookmarks/) bookmark files in a user-friendly way, and (optionally) outputs a PDF file with the specified outline. \n\n## Table of Contents\n\n\n- [pdfoutliner](#pdfoutliner)\n - [Table of Contents](#table-of-contents)\n - [Why](#why)\n - [Installation](#installation)\n - [Sample Usage](#sample-usage)\n - [With PDF I/O:](#with-pdf-io)\n - [Writing a pdftk bookmark file only:](#writing-a-pdftk-bookmark-file-only)\n - [TOC Format](#toc-format)\n - [Specifying structure by subheading numbering](#specifying-structure-by-subheading-numbering)\n - [Specifying structure by indentation](#specifying-structure-by-indentation)\n - [Keeping PDF flat](#keeping-pdf-flat)\n - [Additional Options](#additional-options)\n - [Dependency](#dependency)\n\n\n\n## Why\nInstead of requiring a TOC file like this, as `pdftk` does\n\n BookmarkBegin\n BookmarkTitle: PDF Reference (Version 1.5)\n BookmarkLevel: 1\n BookmarkPageNumber: 1\n BookmarkBegin\n BookmarkTitle: Contents\n BookmarkLevel: 2\n BookmarkPageNumber: 3\n\nTo create a PDF file with a structured/nested outline with the script, you only need a TOC file that looks like this: \n\n PDF Reference (Version 1.5) 1\n Contents 3\n\nor perhaps better, this: \n\n 1 PDF Reference (Version 1.5) 1\n 1.1 Contents 3\n\n## Installation\n\n pip3 install pdfoutliner\n\n## Sample Usage\n\n#### With PDF I/O:\n\n pdfoutliner TOC --inpdf in.pdf -s START\n\nwhere \n\n- `START` is the page in the PDF where p. 1 is supposed to start, and \n- `TOC` is the path to a table of contents file. \n\nSee section [TOC Format](#toc-format) for details on the syntax. \n\n#### Writing a pdftk bookmark file only:\n\n pdfoutliner TOC\n\nFor more options, see section [Additional Options](#additional-options), or use\n\n pdfoutliner -h\n\n## TOC Format\nThe default table of contents format is\n\n 1 Heading 1\n 1.2 Subheading 3\n 1.2.3 Subsubheading 5\n\nEach line has a numbering (not necessarily numerical), a title, and a page number, separated by space characters. \n\nThe script will infer that \"1 Heading\" is level 1, \"1.1 Subheading\" is level 2, and so on. \n\nAlternatively, you can [specify the structure by indentation](#specifying-structure-by-indentation), or [keep the PDF flat](#keeping-pdf-flat). \n\n### Specifying structure by subheading numbering\nThis is the default option. As mentioned, the format is\n\n 1 Heading 1\n 1.1 Subheading 3\n 1.1.1 Subsubheading 5\n\nAnd the script will infer the structure from the numbering. \n\nIf your TOC file looks like \n\n 1. Heading 1\n 1.1. Subheading 3\n 1.1.1. Subsubheading 5\n\ni.e., has a trailing dot after each numbering, you could specify the style of the heading with `--style 1.2.`\n\n### Specifying structure by indentation\nYou could also specify the structure of the outline by indentation with `-d --indentation`, followed by an escaped regex for 1 unit of indentation. \n\nFor example, suppose my TOC looks like\n\n Heading 1\n Subheading 3\n Subsubheading 5\n\nwhere the unit of indentation is 2 spaces, then use\n\n pdfoutliner TOC -d \\\\s\\\\s\n\nAnd the script will infer the structure from the subheading indentations. \n\n### Keeping PDF flat\nUse `-k --keepflat` and the script will ignore any numbering or indentations. The output PDF will have a flat, unstructured outline. \n\n Heading 1\n Subheading 3\n Subsubheading 5\n\n## Additional Options\n usage: pdfoutliner [-h] [-o OUTMARKS] [-d INDENTATION] [-k]\n [--style {1.2,1.2.}] [--outpdf OUTPDF] [--inpdf INPDF]\n [-s START]\n toc\n\n optional arguments:\n -h, --help show this help message and exit\n\n bookmark I/O:\n toc path to TOC file\n -o OUTMARKS, --outmarks OUTMARKS\n name for pdftk bookmarks file. default is original toc\n name + \"_outlined\"\n\n bookmark structure:\n if both -d and -k are specified, -d will take precedence over -k\n\n -d INDENTATION, --indentation INDENTATION\n escaped regex for 1 unit of indentation\n -k, --keepflat keep outline flat\n --style {1.2,1.2.} heading style. with or without a trailing dot. default\n \"1.2\", i.e., no trailing dot\n\n PDF I/O:\n --outpdf OUTPDF path to output PDF file. default is input pdf name +\n \"_outlined.pdf\" in input PDF's directory\n --inpdf INPDF path to input PDF file\n -s START, --start START\n page in the pdf document where page 1 is. default 1\n\n## Dependency\n\n- [pdftk](https://www.pdflabs.com/tools/pdftk-server/)\n - on macOS 10.11+, use the build [here](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg)\n- (optional) [Tabula](http://tabula.technology/)\n - for extracting a usable TOC from PDF files (along with some additional [regex golfing](https://xkcd.com/1313/))\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/GHPen/pdfoutliner", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pdfoutliner", "package_url": "https://pypi.org/project/pdfoutliner/", "platform": "", "project_url": "https://pypi.org/project/pdfoutliner/", "project_urls": { "Homepage": "https://github.com/GHPen/pdfoutliner" }, "release_url": "https://pypi.org/project/pdfoutliner/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Command line interface for generating pdftk-style bookmark files in a user-friendly way, and (optionally) outputs a PDF file with the specified outline.", "version": "0.0.3" }, "last_serial": 4578007, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "2491f9c6aa590964e9559f7e6d322e4b", "sha256": "7c91e0595df86216bfb2ce41e3328f645f4c4871240d26a893011112dca143d6" }, "downloads": -1, "filename": "pdfoutliner-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2491f9c6aa590964e9559f7e6d322e4b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6186, "upload_time": "2018-12-09T05:05:04", "url": "https://files.pythonhosted.org/packages/85/10/943b1b185e40cb12220688a5f6c0a51c105efe47f32179120242a124f7eb/pdfoutliner-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9aceff031a71ca53a3f5cca14f8f37b3", "sha256": "a24f5127464b62bed94aa7a59fc33585a5b22c8565290759ef08825e71b762b8" }, "downloads": -1, "filename": "pdfoutliner-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9aceff031a71ca53a3f5cca14f8f37b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4913, "upload_time": "2018-12-09T05:05:06", "url": "https://files.pythonhosted.org/packages/29/ad/f9730da989ceacb4c9fe5671079493ef0b6bd29a719d9833bd8b71a284d6/pdfoutliner-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "45989229208663f25d82e2d2acf4d176", "sha256": "ee789a0aa7e145c9ffd40b4ef4132e64c4b75e8a07fbd8f7673728ce35f8d970" }, "downloads": -1, "filename": "pdfoutliner-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "45989229208663f25d82e2d2acf4d176", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6289, "upload_time": "2018-12-09T19:48:22", "url": "https://files.pythonhosted.org/packages/1f/1a/324396d9209ab71602f55a8ec6d5bce4c45883bdc253feeba292cfa96dbe/pdfoutliner-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b200d53dca71a00f73123c30ffaeabc", "sha256": "940f40d1928ee738949786bfad77092a0635f111d9868241f7bcf4148af59782" }, "downloads": -1, "filename": "pdfoutliner-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6b200d53dca71a00f73123c30ffaeabc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5030, "upload_time": "2018-12-09T19:48:24", "url": "https://files.pythonhosted.org/packages/f6/77/cb01b5aabd0d18c0ef75281514127deb5fc8a7ce1970edb0a0e2edab7945/pdfoutliner-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "45989229208663f25d82e2d2acf4d176", "sha256": "ee789a0aa7e145c9ffd40b4ef4132e64c4b75e8a07fbd8f7673728ce35f8d970" }, "downloads": -1, "filename": "pdfoutliner-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "45989229208663f25d82e2d2acf4d176", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6289, "upload_time": "2018-12-09T19:48:22", "url": "https://files.pythonhosted.org/packages/1f/1a/324396d9209ab71602f55a8ec6d5bce4c45883bdc253feeba292cfa96dbe/pdfoutliner-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b200d53dca71a00f73123c30ffaeabc", "sha256": "940f40d1928ee738949786bfad77092a0635f111d9868241f7bcf4148af59782" }, "downloads": -1, "filename": "pdfoutliner-0.0.3.tar.gz", "has_sig": false, "md5_digest": "6b200d53dca71a00f73123c30ffaeabc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5030, "upload_time": "2018-12-09T19:48:24", "url": "https://files.pythonhosted.org/packages/f6/77/cb01b5aabd0d18c0ef75281514127deb5fc8a7ce1970edb0a0e2edab7945/pdfoutliner-0.0.3.tar.gz" } ] }