|
7 | 7 | from PySide2.QtWidgets import QApplication, QMainWindow, QFileDialog
|
8 | 8 | from PySide2.QtWidgets import QMessageBox
|
9 | 9 | from markdown import markdown
|
10 |
| -from weasyprint import HTML, CSS |
11 |
| -from weasyprint.fonts import FontConfiguration |
| 10 | +# from weasyprint import HTML, CSS |
| 11 | +# from weasyprint.fonts import FontConfiguration |
12 | 12 |
|
13 | 13 | import util
|
14 | 14 | from contract_generator_ui_model import Ui_MainWindow
|
@@ -447,17 +447,17 @@ def on_generate(self):
|
447 | 447 | msg = "Saved html to " + str(html_path)
|
448 | 448 | QMessageBox.information(self, "Info", msg)
|
449 | 449 |
|
450 |
| - font_config = FontConfiguration() |
451 |
| - html = HTML(string=html) |
452 |
| - css = CSS(string=''' |
453 |
| - @font-face { |
454 |
| - font-family: Helvetica; |
455 |
| - src: url(file:///System/Library/Fonts/Helvetica.ttc); |
456 |
| - } |
457 |
| - p {font-family: Helvetica}''', font_config=font_config) |
458 |
| - html.write_pdf(pdf_path, stylesheets=[css], font_config=font_config) |
459 |
| - msg = "Saved pdf to " + str(pdf_path) |
460 |
| - QMessageBox.information(self, "Info", msg) |
| 450 | + # font_config = FontConfiguration() |
| 451 | + # html = HTML(string=html) |
| 452 | + # css = CSS(string=''' |
| 453 | + # @font-face { |
| 454 | + # font-family: Helvetica; |
| 455 | + # src: url(file:///System/Library/Fonts/Helvetica.ttc); |
| 456 | + # } |
| 457 | + # p {font-family: Helvetica}''', font_config=font_config) |
| 458 | + # html.write_pdf(pdf_path, stylesheets=[css], font_config=font_config) |
| 459 | + # msg = "Saved pdf to " + str(pdf_path) |
| 460 | + # QMessageBox.information(self, "Info", msg) |
461 | 461 |
|
462 | 462 | if __name__ == "__main__":
|
463 | 463 | app = QApplication(sys.argv)
|
|
0 commit comments