Commit Graph

17 Commits

Author SHA1 Message Date
Matthew Stamy 9c8afe6c2e Adding script 2014-12-30 16:07:55 -06:00
Matthew Stamy e29d5bec32 Merging 2014-12-30 16:06:54 -06:00
Matthew Stamy 23299bda38 Create folder for scripts 2014-12-30 15:56:54 -06:00
Matthew Stamy 05989cc368 Replace file() with open() 2014-12-30 15:46:16 -06:00
Ernesto Revilla 164707a64b PEP8 fixes: mixed tabs / spaces, blank lines. 2014-11-26 22:43:35 +01:00
Vitor Figueiro f71e4979fd Add addJS method to PdfFileWriter 2014-07-02 15:50:22 +01:00
switham d10cbb4052 more for issue #70 2014-02-25 01:26:28 -05:00
switham 0a8dc06f41 Fix for pdfcat foo.pdf '-2:' issue #70 2014-02-25 00:19:24 -05:00
switham 6dfc9904f3 pdfcat et al.: now 3.0-compatible.
modified:   PyPDF2/pagerange.py
    Define "Str" (capital S) to mean basestring in 2.x, str in 3.x.
    Used while validating a PageRange initializer.

modified:   Sample_Code/makesimple.py
    from __future__ import print_function
    I guess this would work, except makesimple.py uses reportlab, which
    isn't 3.x compatible yet.

modified:   Sample_Code/pdfcat
    from __future__ import print_function
    Aargh!  PdfFileMerger in 3.x requires that the input files stay
    open while it's doing the write().    So, I went back to caching all
    the  open files in pdfcat.  I do not close them, since pdfcat is just
    a script and exits immediately.  But at least each file is only open
    with one file object.
    Tested in 2.7 and 3.3.  Redirecting stdout works in both on Mac OS X.
2014-01-10 01:01:45 -05:00
switham 6d94e5bf56 pdfcat and pagerange.py: error handling, stdout, misc.
modified:   LICENSE
    Added Steve Witham <switham_github@mac-guyver.com>

modified:   PyPDF2/pagerange.py
    Fixed some error handling.
    Made parse_filename_page_ranges return a list instead of being a generator.
    Tweaked a variable name for readability.

renamed:    Sample_Code/makepages.py -> Sample_Code/makesimple.py
also modified:
    Renamed the code to be similar to makesimple.sh.
    Changed the output file names to be the same as makesimple.sh makes.

modified:   Sample_Code/pdfcat
    Fixed to allow sending output to a file by redirection like with cat,
         pdfcat input*.pdf >output.pdf
    using
         output = os.fdopen(stdout.fileno(), "wb")
    I have not tested this in Windows, but the Python docs say the calls are
    supported in Windows.  The worst problem this could cause would be to
    silence PyPDF2's existing warning about the file being in text mode,
    while still actually writing in Windows text mode.
    Added examples to the --help output to show output-redirect style.

    Took out the caching of open input files.  Needless complication.

    Added a try...except so that if there's a problem while processing an
    input file, print the filename.

    Made quiet the default and --verbose an option.
2014-01-09 15:18:21 -05:00
switham 201ad9f364 pdfcat: better usage example. 2014-01-08 23:03:33 -05:00
switham d158aa52c1 Two scripts to make pdf test files. 2014-01-08 22:46:32 -05:00
switham d68183d316 pagerange.py, pdfcat: using PdfFileMerger and argparse 2014-01-08 22:45:07 -05:00
switham 0430929766 pdfcat, pagerange seem to work, semi-integrated. 2014-01-08 18:24:29 -05:00
Dylan McNamee 629cacad6d Update 2-up.py
Usage string.
2013-12-23 13:44:51 -08:00
Dylan McNamee ddc5fb4e3b simple 2-upping using the library 2013-12-15 10:00:57 -08:00
Matthew Stamy 5141360584 Simplified README, added folder for sample PyPDF2 code 2013-10-08 17:11:06 -05:00