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

Use download attribute in <a> tag for attachment's filename #1126

Closed
nempoBu4 opened this issue May 26, 2020 · 3 comments · Fixed by #1210
Closed

Use download attribute in <a> tag for attachment's filename #1126

nempoBu4 opened this issue May 26, 2020 · 3 comments · Fixed by #1210
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Milestone

Comments

@nempoBu4
Copy link
Contributor

There is download attribute in <a> tag which allows to specify the filename. If the value is specified then it should be used as the filename of attachment. If there is no extension in download attribute then it should be determined from href.
This feature will be especially useful for <a> tags with data URI in href.

download attribute playgroubd

@liZe liZe added feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background labels May 26, 2020
@liZe
Copy link
Member

liZe commented May 26, 2020

Hello!

Thank you for this feature request. If anybody’s interested in diving into WeasyPrint’s code, it’s a good way to start, just ask and I can help.

@lmcnulty
Copy link

lmcnulty commented Jun 9, 2020

@liZe I'd like to give this a shot. It looks like the relevant parts are write_pdf_metadata and _write_pdf_attachment in pdf.py?

@liZe
Copy link
Member

liZe commented Jun 9, 2020

@liZe I'd like to give this a shot. It looks like the relevant parts are write_pdf_metadata and _write_pdf_attachment in pdf.py?

Indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants