M
mascai
Guest
I am using this function
sourceHtml -- is OK (characters are OK)
Function is working OK for English text, but doesn't work for non-English languages I see this picture:
How can I fix this?
Answer for: "xhtml2pdf how to convert non-English chars?"...
sourceHtml -- is OK (characters are OK)
Mã:
def convertHtmlToPdf(sourceHtml, outputFilename):
"""
open output file for writing (truncated binary)
"""
with open("xyz_alex.html", "w") as f:
f.write(sourceHtml)
resultFile = open(outputFilename, "w+b")
# convert HTML to PDF
pisaStatus = pisa.CreatePDF(
src=sourceHtml, # the HTML to convert
dest=resultFile) # file handle to receive result
# close output file
resultFile.close()
# return True on success and False on errors
print("ZZZ_1 ", pisaStatus.err, type(pisaStatus.err)) # PRINTS FALSE
return pisaStatus.err
Function is working OK for English text, but doesn't work for non-English languages I see this picture:
How can I fix this?
Answer for: "xhtml2pdf how to convert non-English chars?"...