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

Error is on HTML.render() #2

Open
epdxb opened this issue Jun 13, 2022 · 2 comments
Open

Error is on HTML.render() #2

epdxb opened this issue Jun 13, 2022 · 2 comments

Comments

@epdxb
Copy link

epdxb commented Jun 13, 2022

Hi,
I am facing error while tying to sign document usign global sign DSS. I am getting below error

Error

File "test.py", line 4, in
document = HTML.render()
TypeError: render() missing 1 required positional argument: 'self'

Code

from weasyprint import HTML
from weasysign import factory

document = HTML.render()

subject_dn = {'subject_dn': {
"common_name": "Dunder Mifflin Paper Company, Inc.",
"organizational_unit": [
"Angela Martin",
"Accounting"
]
}}
signer = factory('globalsign', cfg_file='globalsign_config.ini', subject_dn=subject_dn)
document.write_pdf(target='/tmp/my-digitally-signed-doc.pdf', finisher=signer)

Environment

Ubuntu 18.04.6 LTS
Python 3.8.12
weasyprint 52

@eddiezab
Copy link

Your syntax is incorrect. You are trying to call the render method on the class, not an instantiated object.
document = HTML().render()

@epdxb
Copy link
Author

epdxb commented Jun 13, 2022

Hi Eddie Zab,

Thanks for the response, is there any method in the library to sign an already existing PDF document, instead of rendering HTML file

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

2 participants