1
0

debug_pdf.py 844 B

12345678910111213141516171819202122
  1. import os
  2. from markdown_pdf import MarkdownPdf, Section
  3. docs_dir = r"c:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/docs"
  4. md_file = os.path.join(docs_dir, "Installation_Guide.md")
  5. with open(md_file, "r", encoding="utf-8") as f:
  6. md_content = f.read()
  7. # Let's clean up file:/// paths just like in generate_pdfs.py
  8. root_dir = r"c:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food"
  9. md_content = md_content.replace("file:///" + root_dir + "/docs/", "")
  10. md_content = md_content.replace("file:///" + root_dir + "/", "../")
  11. pdf = MarkdownPdf()
  12. section = Section(md_content, paper_size="A4", root=root_dir)
  13. html_content = pdf.add_section(section)
  14. print("HTML CONTENT LENGTH:", len(html_content))
  15. with open("scratch/inspect_html.html", "w", encoding="utf-8") as f:
  16. f.write(html_content)
  17. print("Saved HTML to scratch/inspect_html.html")