govbridge-api / make_pdf.py
harshrawat18's picture
Upload folder using huggingface_hub
7a56b52 verified
Raw
History Blame Contribute Delete
1.09 kB
import asyncio
from playwright.async_api import async_playwright
async def make_pdf():
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True, args=["--no-sandbox"])
page = await browser.new_page()
content = """
<h1>Gazette of India - Extraordinary</h1>
<h2>Part II - Section 3</h2>
<p><strong>Agricultural Subsidy Amendment 2026</strong></p>
<p>This is a real, officially ingested document to test the GovBridge system.</p>
<p>The Ministry of Agriculture has allocated additional funding for memory and compute infrastructure in rural farming cooperatives.</p>
<p>By implementing this scheme, farmers will receive unprecedented access to digital agricultural markets.</p>
<p>Clause 4: The state of Rajasthan shall be the primary testing ground for this new agricultural framework.</p>
"""
await page.set_content(content)
await page.pdf(path="test_gazette.pdf")
await browser.close()
if __name__ == "__main__":
asyncio.run(make_pdf())