1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "documents": [
9 {
10 "name": "invoice-1001",
11 "html": "<html><body style=\"font-family:sans-serif\"><h1>Invoice #1001</h1><p>Billed to: ACME Ltd</p><table border=\"1\" cellpadding=\"6\"><tr><th>Item</th><th>Amount</th></tr><tr><td>Consulting</td><td>$1,200</td></tr></table></body></html>",
12 },
13 {
14 "name": "hello",
15 "html": "<h1>Hello PDF</h1><p>Rendered by Chrome.</p>",
16 },
17 {
18 "name": "report",
19 "html": "<h2>Weekly report</h2><ul><li>Revenue up 4%</li><li>Churn flat</li></ul>",
20 },
21 ] }
22
23
24run = client.actor("ponderable_hydrometer/html-to-pdf").call(run_input=run_input)
25
26
27print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
28for item in client.dataset(run.default_dataset_id).iterate_items():
29 print(item)
30
31