1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "html_content": "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>Sample Document</title></head><body><h1>Sample Document</h1><p>Apify Store QA sample used as input prefill.</p><h2>Chapter 1</h2><p>Short paragraph for PDF and EPUB conversion.</p><h2>Chapter 2</h2><p>Second chapter so EPUB splits on h2.</p></body></html>",
12 "title": "Sample Document",
13 "author": "Apify QA"
14};
15
16
17const run = await client.actor("interesting_investigator/html-to-pdf-epub-converter").call(input);
18
19
20console.log('Results from dataset');
21console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
22const { items } = await client.dataset(run.defaultDatasetId).listItems();
23items.forEach((item) => {
24 console.dir(item);
25});
26
27