Skip to content

Cannot render emojis or data in different languages #256

@sammathur004aso

Description

@sammathur004aso

PDF conversion issue: Emojis and language rendering problems

Description

When converting HTML to PDF using pdfkit, emojis appear as black boxes or square brackets, and there are difficulties in rendering different languages properly. This issue impacts the visual fidelity of the converted PDF.

Steps to Reproduce

  1. Use the provided html_to_pdf.py script.
    
  2. Include an HTML content with emojis and text in different languages.
    
  3. Execute the script to convert HTML to PDF.
    
  4. Observe the output PDF, [output_pdfkit.pdf](https://github.com/JazzCore/python-pdfkit/files/13856753/output_pdfkit.pdf).
    

html_to_pdf.py

html_content = "<html><body><h1>Hello, PDF! 😊</h1></body></html>"
pdfkit_output_path = "output_pdfkit.pdf"
pdfkit.from_string(html_content, output_pdf_path)

Expected Behavior

Emojis and text in various languages should be correctly rendered in the generated PDF, maintaining visual fidelity with the original HTML.

Actual Behavior

Emojis appear as black boxes or square brackets, and there are rendering issues with different languages, as evidenced by the attached output_pdfkit.pdf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions