HTML string to PDF avatar

HTML string to PDF

Try for free

No credit card required

Go to Store
HTML string to PDF

HTML string to PDF

mhamas/html-string-to-pdf
Try for free

No credit card required

Convert HTML string to A4 PDF.

You can access the HTML string to PDF programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1{
2  "openapi": "3.0.1",
3  "info": {
4    "version": "0.0",
5    "x-build-id": "ltKpmTJSUYFhgfsgZ"
6  },
7  "servers": [
8    {
9      "url": "https://api.apify.com/v2"
10    }
11  ],
12  "paths": {
13    "/acts/mhamas~html-string-to-pdf/run-sync-get-dataset-items": {
14      "post": {
15        "operationId": "run-sync-get-dataset-items-mhamas-html-string-to-pdf",
16        "x-openai-isConsequential": false,
17        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18        "tags": [
19          "Run Actor"
20        ],
21        "requestBody": {
22          "required": true,
23          "content": {
24            "application/json": {
25              "schema": {
26                "$ref": "#/components/schemas/inputSchema"
27              }
28            }
29          }
30        },
31        "parameters": [
32          {
33            "name": "token",
34            "in": "query",
35            "required": true,
36            "schema": {
37              "type": "string"
38            },
39            "description": "Enter your Apify token here"
40          }
41        ],
42        "responses": {
43          "200": {
44            "description": "OK"
45          }
46        }
47      }
48    },
49    "/acts/mhamas~html-string-to-pdf/runs": {
50      "post": {
51        "operationId": "runs-sync-mhamas-html-string-to-pdf",
52        "x-openai-isConsequential": false,
53        "summary": "Executes an Actor and returns information about the initiated run in response.",
54        "tags": [
55          "Run Actor"
56        ],
57        "requestBody": {
58          "required": true,
59          "content": {
60            "application/json": {
61              "schema": {
62                "$ref": "#/components/schemas/inputSchema"
63              }
64            }
65          }
66        },
67        "parameters": [
68          {
69            "name": "token",
70            "in": "query",
71            "required": true,
72            "schema": {
73              "type": "string"
74            },
75            "description": "Enter your Apify token here"
76          }
77        ],
78        "responses": {
79          "200": {
80            "description": "OK",
81            "content": {
82              "application/json": {
83                "schema": {
84                  "$ref": "#/components/schemas/runsResponseSchema"
85                }
86              }
87            }
88          }
89        }
90      }
91    },
92    "/acts/mhamas~html-string-to-pdf/run-sync": {
93      "post": {
94        "operationId": "run-sync-mhamas-html-string-to-pdf",
95        "x-openai-isConsequential": false,
96        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97        "tags": [
98          "Run Actor"
99        ],
100        "requestBody": {
101          "required": true,
102          "content": {
103            "application/json": {
104              "schema": {
105                "$ref": "#/components/schemas/inputSchema"
106              }
107            }
108          }
109        },
110        "parameters": [
111          {
112            "name": "token",
113            "in": "query",
114            "required": true,
115            "schema": {
116              "type": "string"
117            },
118            "description": "Enter your Apify token here"
119          }
120        ],
121        "responses": {
122          "200": {
123            "description": "OK"
124          }
125        }
126      }
127    }
128  },
129  "components": {
130    "schemas": {
131      "inputSchema": {
132        "type": "object",
133        "properties": {
134          "htmlString": {
135            "title": "HTML string",
136            "type": "string",
137            "description": "HTML string"
138          }
139        }
140      },
141      "runsResponseSchema": {
142        "type": "object",
143        "properties": {
144          "data": {
145            "type": "object",
146            "properties": {
147              "id": {
148                "type": "string"
149              },
150              "actId": {
151                "type": "string"
152              },
153              "userId": {
154                "type": "string"
155              },
156              "startedAt": {
157                "type": "string",
158                "format": "date-time",
159                "example": "2025-01-08T00:00:00.000Z"
160              },
161              "finishedAt": {
162                "type": "string",
163                "format": "date-time",
164                "example": "2025-01-08T00:00:00.000Z"
165              },
166              "status": {
167                "type": "string",
168                "example": "READY"
169              },
170              "meta": {
171                "type": "object",
172                "properties": {
173                  "origin": {
174                    "type": "string",
175                    "example": "API"
176                  },
177                  "userAgent": {
178                    "type": "string"
179                  }
180                }
181              },
182              "stats": {
183                "type": "object",
184                "properties": {
185                  "inputBodyLen": {
186                    "type": "integer",
187                    "example": 2000
188                  },
189                  "rebootCount": {
190                    "type": "integer",
191                    "example": 0
192                  },
193                  "restartCount": {
194                    "type": "integer",
195                    "example": 0
196                  },
197                  "resurrectCount": {
198                    "type": "integer",
199                    "example": 0
200                  },
201                  "computeUnits": {
202                    "type": "integer",
203                    "example": 0
204                  }
205                }
206              },
207              "options": {
208                "type": "object",
209                "properties": {
210                  "build": {
211                    "type": "string",
212                    "example": "latest"
213                  },
214                  "timeoutSecs": {
215                    "type": "integer",
216                    "example": 300
217                  },
218                  "memoryMbytes": {
219                    "type": "integer",
220                    "example": 1024
221                  },
222                  "diskMbytes": {
223                    "type": "integer",
224                    "example": 2048
225                  }
226                }
227              },
228              "buildId": {
229                "type": "string"
230              },
231              "defaultKeyValueStoreId": {
232                "type": "string"
233              },
234              "defaultDatasetId": {
235                "type": "string"
236              },
237              "defaultRequestQueueId": {
238                "type": "string"
239              },
240              "buildNumber": {
241                "type": "string",
242                "example": "1.0.0"
243              },
244              "containerUrl": {
245                "type": "string"
246              },
247              "usage": {
248                "type": "object",
249                "properties": {
250                  "ACTOR_COMPUTE_UNITS": {
251                    "type": "integer",
252                    "example": 0
253                  },
254                  "DATASET_READS": {
255                    "type": "integer",
256                    "example": 0
257                  },
258                  "DATASET_WRITES": {
259                    "type": "integer",
260                    "example": 0
261                  },
262                  "KEY_VALUE_STORE_READS": {
263                    "type": "integer",
264                    "example": 0
265                  },
266                  "KEY_VALUE_STORE_WRITES": {
267                    "type": "integer",
268                    "example": 1
269                  },
270                  "KEY_VALUE_STORE_LISTS": {
271                    "type": "integer",
272                    "example": 0
273                  },
274                  "REQUEST_QUEUE_READS": {
275                    "type": "integer",
276                    "example": 0
277                  },
278                  "REQUEST_QUEUE_WRITES": {
279                    "type": "integer",
280                    "example": 0
281                  },
282                  "DATA_TRANSFER_INTERNAL_GBYTES": {
283                    "type": "integer",
284                    "example": 0
285                  },
286                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
287                    "type": "integer",
288                    "example": 0
289                  },
290                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
291                    "type": "integer",
292                    "example": 0
293                  },
294                  "PROXY_SERPS": {
295                    "type": "integer",
296                    "example": 0
297                  }
298                }
299              },
300              "usageTotalUsd": {
301                "type": "number",
302                "example": 0.00005
303              },
304              "usageUsd": {
305                "type": "object",
306                "properties": {
307                  "ACTOR_COMPUTE_UNITS": {
308                    "type": "integer",
309                    "example": 0
310                  },
311                  "DATASET_READS": {
312                    "type": "integer",
313                    "example": 0
314                  },
315                  "DATASET_WRITES": {
316                    "type": "integer",
317                    "example": 0
318                  },
319                  "KEY_VALUE_STORE_READS": {
320                    "type": "integer",
321                    "example": 0
322                  },
323                  "KEY_VALUE_STORE_WRITES": {
324                    "type": "number",
325                    "example": 0.00005
326                  },
327                  "KEY_VALUE_STORE_LISTS": {
328                    "type": "integer",
329                    "example": 0
330                  },
331                  "REQUEST_QUEUE_READS": {
332                    "type": "integer",
333                    "example": 0
334                  },
335                  "REQUEST_QUEUE_WRITES": {
336                    "type": "integer",
337                    "example": 0
338                  },
339                  "DATA_TRANSFER_INTERNAL_GBYTES": {
340                    "type": "integer",
341                    "example": 0
342                  },
343                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
344                    "type": "integer",
345                    "example": 0
346                  },
347                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
348                    "type": "integer",
349                    "example": 0
350                  },
351                  "PROXY_SERPS": {
352                    "type": "integer",
353                    "example": 0
354                  }
355                }
356              }
357            }
358          }
359        }
360      }
361    }
362  }
363}

HTML string to PDF OpenAPI definition

OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.

OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.

By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.

You can download the OpenAPI definitions for HTML string to PDF from the options below:

If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.

You can also check out our other API clients:

Developer
Maintained by Community

Actor Metrics

  • 3 monthly users

  • 5 bookmarks

  • 97% runs succeeded

  • Created in Aug 2020

  • Modified 22 days ago