Skip to content

Commit cc29f81

Browse files
committed
use imgkit instead for html2svg
1 parent c039d3c commit cc29f81

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.github/workflows/getbadge.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
python-version: 3.7
2525

2626
- name: Install deps
27-
run: pip install numpy pandas aspose-words
27+
run: |
28+
pip install numpy pandas imgkit
29+
apt-get install wkhtmltopdf
2830
2931
- name: Get info
3032
run: |

assets/generate_badge.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
import pandas as pd
3-
import aspose.words as aw
3+
import imgkit
44

55

66
path = "filedownloads?parentAlias=ntnu"
@@ -22,17 +22,8 @@
2222

2323
print("generated html line: ", ret)
2424

25-
# with open("test.html", "w") as f:
26-
# f.write(ret)
25+
with open("test.html", "w") as f:
26+
f.write(ret)
2727

28-
# create blank document
29-
doc = aw.Document()
30-
31-
# Use a document builder to add content to the document
32-
builder = aw.DocumentBuilder(doc)
33-
34-
# Write a new paragraph in the document with the text generated above into the file
35-
builder.writeln(ret)
36-
37-
# Save the document in DOCX format. Save format is automatically determined from the file extension.
38-
doc.save("test.svg")
28+
with open('test.html', "w") as ff:
29+
imgkit.from_file(ff, 'test.svg')

0 commit comments

Comments
 (0)