Merge branch 'master' of https://github.com/mstamy2/PyPDF2
This commit is contained in:
commit
94a208e292
|
@ -113,7 +113,7 @@ class PdfFileMerger(object):
|
|||
if isString(fileobj):
|
||||
fileobj = file(fileobj, 'rb')
|
||||
my_file = True
|
||||
elif isinstance(fileobj, file):
|
||||
elif hasattr(fileobj, "seek") and hasattr(fileobj, "read"):
|
||||
fileobj.seek(0)
|
||||
filecontent = fileobj.read()
|
||||
fileobj = StreamIO(filecontent)
|
||||
|
|
|
@ -2057,7 +2057,7 @@ class PdfFileReader(object):
|
|||
if encrypt['/Filter'] != '/Standard':
|
||||
raise NotImplementedError("only Standard PDF encryption handler is available")
|
||||
if not (encrypt['/V'] in (1, 2)):
|
||||
raise NotImplementedError("only algorithm code 1 and 2 are supported")
|
||||
raise NotImplementedError("only algorithm code 1 and 2 are supported. This PDF uses code %s" % encrypt['/V'])
|
||||
user_password, key = self._authenticateUserPassword(password)
|
||||
if user_password:
|
||||
self._decryption_key = key
|
||||
|
@ -2226,7 +2226,8 @@ class PageObject(DictionaryObject):
|
|||
return self
|
||||
|
||||
def _rotate(self, angle):
|
||||
currentAngle = self.get("/Rotate", 0)
|
||||
rotateObj = self.get("/Rotate", 0)
|
||||
currentAngle = rotateObj if isinstance(rotateObj, int) else rotateObj.getObject()
|
||||
self[NameObject("/Rotate")] = NumberObject(currentAngle + angle)
|
||||
|
||||
def _mergeResources(res1, res2, resource):
|
||||
|
@ -2665,6 +2666,7 @@ class PageObject(DictionaryObject):
|
|||
_text = operands[0]
|
||||
if isinstance(_text, TextStringObject):
|
||||
text += _text
|
||||
text += "\n"
|
||||
elif operator == b_("T*"):
|
||||
text += "\n"
|
||||
elif operator == b_("'"):
|
||||
|
|
12
README.md
12
README.md
|
@ -1,4 +1,4 @@
|
|||
#PyPDF2
|
||||
# PyPDF2
|
||||
|
||||
PyPDF2 is a pure-python PDF library capable of
|
||||
splitting, merging together, cropping, and transforming
|
||||
|
@ -10,22 +10,22 @@ as merge entire files together.
|
|||
Homepage
|
||||
http://mstamy2.github.io/PyPDF2/
|
||||
|
||||
##Examples
|
||||
## Examples
|
||||
|
||||
Please see `sample code` folder
|
||||
Please see the `Sample_Code` folder.
|
||||
|
||||
##Documentation
|
||||
## Documentation
|
||||
|
||||
Documentation is available at
|
||||
https://pythonhosted.org/PyPDF2/
|
||||
|
||||
|
||||
##FAQ
|
||||
## FAQ
|
||||
Please see
|
||||
http://mstamy2.github.io/PyPDF2/FAQ.html
|
||||
|
||||
|
||||
##Tests
|
||||
## Tests
|
||||
PyPDF2 includes a test suite built on the unittest framework. All tests are located in the "Tests" folder.
|
||||
Tests can be run from the command line by:
|
||||
|
||||
|
|
Loading…
Reference in New Issue