Moses Paul R
commited on
Commit
·
69b4d9a
1
Parent(s):
86ab66e
fix powerpoint temp file
Browse files
marker/providers/powerpoint.py
CHANGED
|
@@ -61,7 +61,7 @@ class PowerPointProvider(PdfProvider):
|
|
| 61 |
def __del__(self):
|
| 62 |
if os.path.exists(self.temp_pdf_path):
|
| 63 |
print(f"Deleting temporary PDF file: {self.temp_pdf_path}")
|
| 64 |
-
|
| 65 |
|
| 66 |
def convert_pptx_to_pdf(self, filepath):
|
| 67 |
pptx = Presentation(filepath)
|
|
@@ -103,9 +103,6 @@ class PowerPointProvider(PdfProvider):
|
|
| 103 |
html = '\n'.join(html_parts)
|
| 104 |
|
| 105 |
# We convert the HTML into a PDF
|
| 106 |
-
open(self.temp_pdf_path + '.html', "w").write(html)
|
| 107 |
-
print(self.temp_pdf_path + '.html')
|
| 108 |
-
|
| 109 |
HTML(string=html).write_pdf(
|
| 110 |
self.temp_pdf_path,
|
| 111 |
stylesheets=[CSS(string=css)]
|
|
|
|
| 61 |
def __del__(self):
|
| 62 |
if os.path.exists(self.temp_pdf_path):
|
| 63 |
print(f"Deleting temporary PDF file: {self.temp_pdf_path}")
|
| 64 |
+
os.remove(self.temp_pdf_path)
|
| 65 |
|
| 66 |
def convert_pptx_to_pdf(self, filepath):
|
| 67 |
pptx = Presentation(filepath)
|
|
|
|
| 103 |
html = '\n'.join(html_parts)
|
| 104 |
|
| 105 |
# We convert the HTML into a PDF
|
|
|
|
|
|
|
|
|
|
| 106 |
HTML(string=html).write_pdf(
|
| 107 |
self.temp_pdf_path,
|
| 108 |
stylesheets=[CSS(string=css)]
|