File size: 1,086 Bytes
7a56b52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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())