MCPcopy
hub / github.com/stitionai/devika / PDF

Class PDF

src/documenter/pdf.py:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6from src.config import Config
7
8class PDF:
9 def __init__(self):
10 config = Config()
11 self.pdf_path = config.get_pdfs_dir()
12
13 def markdown_to_pdf(self, markdown_string, project_name):
14 html_string = markdown(markdown_string)
15
16 out_file_path = os.path.join(self.pdf_path, f"{project_name}.pdf")
17 with open(out_file_path, "wb") as out_file:
18 pisa_status = pisa.CreatePDF(html_string, dest=out_file)
19
20 if pisa_status.err:
21 raise Exception("Error generating PDF")
22
23 return out_file_path

Callers 2

make_decisionMethod · 0.90
subsequent_executeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected