Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Page' object has no attribute 'rotationMatrix' #143

Closed
srszzw opened this issue Jun 22, 2022 · 2 comments
Closed

'Page' object has no attribute 'rotationMatrix' #143

srszzw opened this issue Jun 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@srszzw
Copy link

srszzw commented Jun 22, 2022

Traceback (most recent call last):
File "d:/temp/pdf2doc/pdf2doc.py", line 8, in
cv.convert(docx_file) # all pages by default
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\converter.py", line 328, in convert
self.parse(start, end, pages, **settings).make_docx(docx_filename, **settings)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\converter.py", line 112, in parse
.parse_document(**kwargs)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\converter.py", line 152, in parse_document
self._pages.parse(self.fitz_doc, **kwargs)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\page\Pages.py", line 36, in parse
raw_page.restore(**settings)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\common\share.py", line 226, in inner
objects = func(*args, **kwargs)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\page\RawPage.py", line 74, in restore
raw_dict = self.extract_raw_dict(**settings)
File "D:\anaconda\envs\pdf2doc\lib\site-packages\pdf2docx\page\RawPage.py", line 279, in extract_raw_dict
Element.set_rotation_matrix(self.fitz_page.rotationMatrix)
AttributeError: 'Page' object has no attribute 'rotationMatrix'

need to delete this line in the file RawPage.py:
Element.set_rotation_matrix(self.fitz_page.rotationMatrix)
then the code can run successfully

@dothinking
Copy link
Contributor

Same issue with #139 and #141.

Please apply the fix manually, or just upgrade pdf2docx to v0.5.4.

pip install pdf2docx --upgrade

@dothinking dothinking self-assigned this Jun 22, 2022
@dothinking dothinking added bug Something isn't working duplicate This issue or pull request already exists labels Jun 22, 2022
@wlevene
Copy link

wlevene commented Oct 4, 2024

pdf2document.com - No loss of pdf layout
30 free page conversions daily for all users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants