You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
when i use other font (e.g. persion font)in html, css occured this error:
Exception has occurred: OSError
wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentNotFoundError
test.py :
from jinja2 import Template
from pdfkit import pdfkit
sample_data = [{'name': 'برزینی', 'text': "فرمول منو این هیبریدی ما او مردی و زانو بنیان "},
{'name': 'صادقی', 'text': """فرمول منو این هیبریدی ما او مردی و زانو بنیان"""},
{'name': 'برزینی', 'text': """فرمول منو این هیبریدی ما او مردی و زانو بنیان """}]
with open('test.html', 'r') as template_file:
template_str = template_file.read()
template = Template(template_str)
forsa in sample_data:
sa['text'] = arabic_reshaper.reshape(sa['text'])
resume_str = template.render({'contents': sample_data})
options = {'encoding': "utf-8", 'quiet': ''}
bytes_array = pdfkit.PDFKit(resume_str, 'string', options=options).to_pdf()
with open('result.pdf', 'wb') as output:
output.write(bytes_array)```
test.html :
```<!DOCTYPE html>
<html>
<head lang="fa-IR">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="static/style.css">
</head>
<style>
@font-face {
font-family: "bnazanin";
src: url("./static/fonts/BNazanin.woff");
}
body{
font-family: "bnazanin";text-align: justify;
direction: rtl;
}
</style>
<body>
<p>1401/08/18</p>
{% forcontent in contents %}
<div style="font-size:25px;padding: 15px">
<p>
<span style="color:rgb(9, 99, 61);">{{ content.name |safe}} : </span>
<span style="color: red;">{{content.text |safe}}</span>
<!-- qweqwe : Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugit omnis magnam harum atque esse nemo maxime, culpa modi suscipit doloribus voluptatem minima laborum provident consequatur vero eligendi molestiae velit! Accusamus? -->
</p>
</div>
{% endfor %}
</body>
</html>```
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when i use other font (e.g. persion font)in html, css occured this error:
Exception has occurred: OSError
wkhtmltopdf reported an error:
Exit with code 1 due to network error: ContentNotFoundError
The text was updated successfully, but these errors were encountered: