1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "html": """<!doctype html>
10<html><head><meta charset=\"utf-8\"><title>Invoice 1001</title>
11<style>
12 body { font-family: Helvetica, Arial, sans-serif; color: #222; margin: 0; }
13 h1 { color: #0f766e; margin: 0 0 4px; }
14 .muted { color: #666; }
15 table { width: 100%; border-collapse: collapse; margin-top: 24px; }
16 th { background: #0f766e; color: #fff; text-align: left; padding: 8px; }
17 td { border-bottom: 1px solid #ddd; padding: 8px; }
18 .right { text-align: right; }
19 .total td { font-weight: bold; border-bottom: none; }
20</style></head>
21<body>
22 <h1>Invoice 1001</h1>
23 <div class=\"muted\">Issued 10 November 2026 · Due 10 December 2026</div>
24 <p><b>Acme Studio Ltd</b><br>1 Example Street, London</p>
25 <p>Billed to: <b>Example Corp</b></p>
26 <table>
27 <tr><th>Item</th><th class=\"right\">Qty</th><th class=\"right\">Price</th><th class=\"right\">Amount</th></tr>
28 <tr><td>Website design</td><td class=\"right\">1</td><td class=\"right\">$1,200.00</td><td class=\"right\">$1,200.00</td></tr>
29 <tr><td>Hosting, 12 months</td><td class=\"right\">12</td><td class=\"right\">$15.00</td><td class=\"right\">$180.00</td></tr>
30 <tr class=\"total\"><td colspan=\"3\" class=\"right\">Total</td><td class=\"right\">$1,380.00</td></tr>
31 </table>
32</body></html>""",
33 "documents": [],
34}
35
36
37run = client.actor("pikoulas/html-to-pdf").call(run_input=run_input)
38
39
40print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
41for item in client.dataset(run.default_dataset_id).iterate_items():
42 print(item)
43
44