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

merge fails when a PPT converted to PDF using google docs slide is used #602

Closed
abhardwaj29 opened this issue Feb 2, 2021 · 7 comments
Closed
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF needs-example-code The issue needs a minimal and complete (e.g. all imports) example showing the problem needs-pdf The issue needs a PDF file to show the problem PdfMerger The PdfMerger component is affected

Comments

@abhardwaj29
Copy link


decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]
--
return decimal.Decimal.__new__(cls, str(value)) File "/usr/local/lib/python3.9/site-packages/PyPDF4/generic.py", line 232, in __new__return FloatObject(num)


I have a PDF file that I generated from a PPT using google docs, I checked the file metadata and that says PDF version is 1.4 but if I save the same ppt as PDF using office it creates a PDF version 1.7

In case of 1.4 I am getting that error when merging PDF.

@ktowen
Copy link

ktowen commented Jun 22, 2021

Any news on this?

@MartinThoma
Copy link
Member

Could that be related? #387

@MartinThoma MartinThoma added the is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF label Apr 7, 2022
@MartinThoma
Copy link
Member

Can you share a PDF that shows the issue?

@MartinThoma
Copy link
Member

Can you share the code you wrote that lead to this issue?

@Atlasfreak
Copy link

As I am currently getting the same error I can confirm that #387 fixes the issue. At least the changes for generic.py, the changes in pdf.py are unrelated.
I am currently not able to share a pdf that creates this issue.

@MartinThoma MartinThoma added the PdfMerger The PdfMerger component is affected label Jun 19, 2022
@MartinThoma MartinThoma changed the title PyPDF2 merge fails when a PPT converted to PDF using google docs slide is used. merge fails when a PPT converted to PDF using google docs slide is used Jul 10, 2022
@MartinThoma MartinThoma added the needs-pdf The issue needs a PDF file to show the problem label Jul 10, 2022
@MartinThoma
Copy link
Member

Can somebody please check if the issue still appears with the latest version of PyPDF2?

@MartinThoma MartinThoma added the needs-example-code The issue needs a minimal and complete (e.g. all imports) example showing the problem label Aug 6, 2022
@MartinThoma
Copy link
Member

I tried to reproduce it like this:

>>> from PyPDF2 import PdfReader, PdfMerger
>>> merger = PdfMerger()
>>> for pdf in ["crazyones.pdf", "google-slides-pdf.pdf"]:
...   merger.append(pdf)
... 
>>> merger.write("out.pdf")
>>> merger.close()

Worked fine with PyPDF2==2.9.0.

As I cannot reproduce it due to the lack of code and a PDF file, I close it. It might also have been solved by other changes.

Please let me know if you still encounter this issue with the latest PyPDF2 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is-bug From a users perspective, this is a bug - a violation of the expected behavior with a compliant PDF needs-example-code The issue needs a minimal and complete (e.g. all imports) example showing the problem needs-pdf The issue needs a PDF file to show the problem PdfMerger The PdfMerger component is affected
Projects
None yet
Development

No branches or pull requests

4 participants