Skip to content

Commit

Permalink
enhance md to pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
hrfng committed Jan 8, 2024
1 parent 8b72df5 commit 7c55083
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bisheng_unstructured/topdf/text2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def __init__(self, kwargs={}):
cmd_template = """
pandoc -o {1} --pdf-engine=xelatex
--lua-filter=/opt/pandoc/unnested-table.lua
--template /opt/pandoc/pandoc-3.1.9/share/templates/default.latex
{0}
-V mainfont="Alibaba PuHuiTi"
-V sansfont="Alibaba PuHuiTi"
-V monofont="Cascadia Mono"
-V monofont="Adobe Heiti Std"
-V CJKmainfont="Alibaba PuHuiTi"
-V CJKsansfont="Alibaba PuHuiTi"
-V CJKmonofont="Adobe Heiti Std"
Expand Down
10 changes: 9 additions & 1 deletion tests/test_text2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def test3():
engine.render(input_file, output_file)


def test4():
input_file = "./examples/docs/4d9dce37d9c5d7542ca89bf8c1984e7f.md"
output_file = "./data/4d9dce37d9c5d7542ca89bf8c1984e7f.pdf"
engine = Text2PDF()
engine.render(input_file, output_file)


test4()
# test1()
test2()
# test2()
# test3()

0 comments on commit 7c55083

Please sign in to comment.