fix: Add layout direction to pdf template

This commit is contained in:
Suraj Shetty 2021-07-05 14:44:04 +05:30
parent 6e92cda34a
commit 0b3402236c
2 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html lang={{ lang }} dir={{ layout_direction }}>
<head>
<meta charset="utf-8">

View file

@ -13,7 +13,7 @@ from PyPDF2 import PdfFileReader, PdfFileWriter
import frappe
from frappe import _
from frappe.utils import scrub_urls
from frappe.utils.jinja_globals import bundled_asset
from frappe.utils.jinja_globals import bundled_asset, is_rtl
PDF_CONTENT_ERRORS = ["ContentNotFoundError", "ContentOperationNotPermittedError",
"UnknownContentError", "RemoteHostClosedError"]
@ -177,7 +177,9 @@ def prepare_header_footer(soup):
"content": content,
"styles": styles,
"html_id": html_id,
"css": css
"css": css,
"lang": frappe.local.lang,
"layout_direction": "rtl" if is_rtl else "ltr"
})
# create temp file