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

Windows Getting PDF error 135 when opening with Adobe #1343

Closed
phirst opened this issue Apr 24, 2021 · 4 comments
Closed

Windows Getting PDF error 135 when opening with Adobe #1343

phirst opened this issue Apr 24, 2021 · 4 comments

Comments

@phirst
Copy link

phirst commented Apr 24, 2021

So... I have a weird issue. Builds fine on a Mac and the PDF opens without issue. However, when building with Windows (same versions of python and modules), I get an Adobe error 135. Opening with Acrobat Pro DC, then going to the Preflight tools and using the analysis tool, it shows:

  • Unable to analyze the content stream on page 17: parse error : "Dictionary keys must be direct name objects"
  • Unable to analyze the content stream on page 18: parse error : "Dictionary keys must be direct name objects"

If it happens on both Mac and Windows, I'd think the HTML was bad. It's fairly basic css and some tables.

Here are the module versions (Python 3.8.9):

altgraph==0.17
cairocffi==1.2.0
CairoSVG==2.5.1
certifi==2020.12.5
cffi==1.14.5
chardet==4.0.0
cssselect2==0.4.1
cycler==0.10.0
defusedxml==0.7.1
future==0.18.2
Gooey==1.0.2
html5lib==1.1
idna==2.10
kiwisolver==1.3.1
matplotlib==3.4.1
numpy==1.20.2
pandas==1.2.4
pangocffi==0.10.0
pefile==2019.4.18
Pillow==8.2.0
psutil==5.8.0
py42==1.14.0
pycparser==2.20
pyinstaller==4.3
pyinstaller-hooks-contrib==2021.1
pyparsing==2.4.7
Pyphen==0.10.0
python-dateutil==2.8.1
pytz==2021.1
pywin32-ctypes==0.2.0
requests==2.25.1
simplejson==3.17.2
six==1.15.0
tabulate==0.8.9
tinycss2==1.1.0
tqdm==4.60.0
urllib3==1.26.4
WeasyPrint==52.5
webencodings==0.5.1
wxPython==4.1.1
XlsxWriter==1.3.9

Any thoughts?

@liZe
Copy link
Member

liZe commented Apr 24, 2021

Hello!

I think that your issue is a duplicate of #1292. Feel free to reopen if it’s a different issue!

@liZe liZe closed this as completed Apr 24, 2021
@phirst
Copy link
Author

phirst commented Apr 26, 2021

@liZe - Thanks, but a clarification:

This bug is caused by a bug in Cairo 1.17.4: https://gitlab.freedesktop.org/cairo/cairo/-/issues/449

Cairo 1.17.4 is not a stable versions and suffers from many bugs. Using the latest version of Cairo instead (1.16.0) fixes this problem.

Also note that the current master branch doesn’t use Cairo anymore.

Seeing as how this appears to be a Windows problem, I can't see how to modify the Windows version of Cairo ( https://gitlab.freedesktop.org/cairo/cairo ) as it's managed by GTK+ and there doesn't appear to be any sort of Cairo package for Windows. What would be the workaround here?

Also, you mention that Also note that the current master branch doesn’t use Cairo anymore.. Any ideas of when 53 may be available?

@liZe
Copy link
Member

liZe commented Apr 26, 2021

Seeing as how this appears to be a Windows problem, I can't see how to modify the Windows version of Cairo ( https://gitlab.freedesktop.org/cairo/cairo ) as it's managed by GTK+ and there doesn't appear to be any sort of Cairo package for Windows. What would be the workaround here?

You can use a previous version of GTK+. Version 2020-11-22 includes Cairo 1.17.2 that doesn’t have this bug.

Also, you mention that Also note that the current master branch doesn’t use Cairo anymore.. Any ideas of when 53 may be available?

When all the regressions between 52 and 53 are fixed 😄. You can already try the beta version using pip install --pre weasyprint if you’re interested.

@ay1man4
Copy link

ay1man4 commented Jun 29, 2021

I tried v52.4 and found issue fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants