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

My Css code not work properly when i convert html to pdf by pdfkit #1532

Closed
Ar-Anik opened this issue Jul 1, 2024 · 1 comment
Closed

My Css code not work properly when i convert html to pdf by pdfkit #1532

Ar-Anik opened this issue Jul 1, 2024 · 1 comment

Comments

@Ar-Anik
Copy link

Ar-Anik commented Jul 1, 2024

why my css code not work when i convert html to pdf by pdfkit?

in html file i use some css code, here css not work properly, css :before and :after selector not work, margin not work properly my and other some css not work .

my html file link : https://pastebin.com/nPafLyLb

code :

import pdfkit
options = {
    'page-size': 'A4',
    'orientation': 'Landscape',
    'margin-top': '0mm',
    'margin-right': '0mm',
    'margin-bottom': '0mm',
    'margin-left': '0mm',
    'encoding': "UTF-8",
    'no-outline': None,
    'enable-local-file-access': None
}
html_string = render_to_string('elm/exam_record/certificate.html')
pdfkit.from_string(html_s, 'output5.pdf', options=options)

Your environment

  • pdfkit version: 1.0.0
  • Django version: 4.2.7
  • python version: 3.10
  • Browser version (if applicable): chrome latest
  • Operating System: linux mint
  • wkhtmltopdf version: 0.12.6
@kishaningithub
Copy link

I don't think this library is meant for converting html to pdf

@liborm85 liborm85 closed this as completed Jul 7, 2024
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