1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "markdown": """# My Document
9
10This is a **bold** statement and this is _italic_ text.
11
12## Features
13
14- Supports **Markdown** syntax
15- Multiple themes available
16- Generates print-ready PDFs
17
18## Code Example
19
20```javascript
21const greeting = 'Hello, World!';
22console.log(greeting);
23```
24
25## Data Table
26
27| Name | Role | Status |
28|------|------|--------|
29| Alice | Developer | Active |
30| Bob | Designer | Active |
31| Carol | Manager | Active |
32
33## Summary
34
35This document was generated by the **Markdown to PDF Converter** actor on [Apify](https://apify.com). It supports all standard Markdown features including:
36
371. Headings (H1–H6)
382. Lists and nested lists
393. Code blocks with syntax hints
404. Tables
415. Links and images
426. Blockquotes
43
44> This is a blockquote — great for callouts and notes.
45
46Enjoy your PDF!""" }
47
48
49run = client.actor("automation-lab/markdown-to-pdf").call(run_input=run_input)
50
51
52print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
53for item in client.dataset(run["defaultDatasetId"]).iterate_items():
54 print(item)
55
56