Switch to PyPDF3

This commit is contained in:
Nemo 2021-05-28 21:38:53 +05:30
parent d047844ad0
commit 044d21b8bc
3 changed files with 16 additions and 6 deletions

View File

@ -2,8 +2,7 @@
pystitcher
==========
pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input file.
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
@ -12,6 +11,10 @@ Description
Given this input::
existing_bookmarks: flatten
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)
@ -35,10 +38,17 @@ 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/0.0.1
Producer: pystitcher/0.0.1
Configuration options can be specified with Meta data at the top of the file. These include:
.. _pyscaffold-notes:
Note

View File

@ -41,7 +41,7 @@ python_requires = >=3.6
install_requires =
importlib-metadata; python_version<"3.8"
# Read and write bookmarks from PDF
PyPDF2>=1.26.0
PyPDF3>=1.0.4
# Read the input file and convert it to HTML
Markdown>=3.3.4
# Parse the HTML to generate bookmarks

View File

@ -2,7 +2,7 @@ import os
import markdown
from .bookmark import Bookmark
import html5lib
from PyPDF2 import PdfFileWriter, PdfFileReader
from PyPDF3 import PdfFileWriter, PdfFileReader
from pystitcher import __version__
import tempfile
import logging