
Labels = [ 'Title', 'Author', 'Creator', 'Producer', 'CreationDate', """Extracts the right hand value from a : delimited row""" Raise RuntimeError( 'Provided input file not found: %s' % infile) Raise RuntimeError( 'System command not found: %s' % cmd) This function parses the text output that looks like this:
#Pdfinfo python pdf#
Wraps command line utility pdfinfo to extract the PDF meta information. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVERĬAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEįOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALĭAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREĭISCLAIMED. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"ĪND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE This software without specific prior written permission.

* Neither the name of the copyright holder nor the names of itsĬontributors may be used to endorse or promote products derived from This list of conditions and the following disclaimer in the documentationĪnd/or other materials provided with the distribution. * Redistributions in binary form must reproduce the above copyright notice, List of conditions and the following disclaimer. * Redistributions of source code must retain the above copyright notice, this Modification, are permitted provided that the following conditions are met:

Redistribution and use in source and binary forms, with or without This function parses the text output that looks like this: Title: PUBLIC MEETING AGENDAĬopyright (c) 2019-2022, the respective contributors, as shown by the AUTHORS file. Though there's almost certainly a better way of getting this info with a native Python PDF package. The poppler package appears to be present on MacOS via brew so this script could be adapted to work on MacOS as well.
#Pdfinfo python install#
On debian like Linux, you can install that like this: sudo apt-get install poppler-utils This script assumes that the pdfinfo command line command is available at /usr/bin/pdfinfo.
