\\\",\\n \\\"css_content\\\" : \\\".tweet-text{background-color:#fff2ac;background-image:linear-gradient(to right,#ffe359 0,#fff2ac 100%);font-weight:bolder;font-size:32px;font-family:Roboto,sans-serif;padding:4px}\\\",\\n \\\"generate_img_url\\\": true\\n}\",\"__typename\":\"OauthBody\"},\"bodyParams\":[],\"authorization\":{\"type\":null,\"basicUsername\":\"\",\"basicPassword\":\"\",\"bearerToken\":\"\",\"oauthAccessToken\":null,\"oauthRefreshToken\":null,\"oauthSignerUri\":null,\"__typename\":\"Authorization\"},\"extracts\":[],\"metadataExtracts\":[],\"cellParams\":[],\"tab\":\"Body\",\"__typename\":\"OauthReq\"},\"marketplaceContent\":null,\"integrationConnections\":{\"nodes\":[{\"id\":\"int_7vs4eyB0\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-requests-from-http-webhook-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Requests from HTTP / Webhook API\",\"triggerKey\":\"http-new-requests\",\"triggerApp\":{\"id\":\"app_X7LhNG\",\"name\":\"HTTP / Webhook\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_n4sOborg\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-item-in-feed-from-rss-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Item in Feed from RSS API\",\"triggerKey\":\"rss-new-item-in-feed\",\"triggerApp\":{\"id\":\"app_mn5hdV\",\"name\":\"RSS\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_vMsvDd4o\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-message-instant-from-discord-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Message (Instant) from Discord API\",\"triggerKey\":\"discord-new-message\",\"triggerApp\":{\"id\":\"app_13GhGn\",\"name\":\"Discord\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_6PsBLmp1\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-message-in-channels-instant-from-slack-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Message In Channels (Instant) from Slack API\",\"triggerKey\":\"slack-new-message-in-channels\",\"triggerApp\":{\"id\":\"app_OkrhR1\",\"name\":\"Slack (legacy)\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_8YsPXoPd\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-message-in-channel-from-discord-bot-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Message in Channel from Discord Bot API\",\"triggerKey\":\"discord_bot-new-message-in-channel\",\"triggerApp\":{\"id\":\"app_OQYhyP\",\"name\":\"Discord Bot\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_rDsvN8RO\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-submission-from-typeform-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Submission from Typeform API\",\"triggerKey\":\"typeform-new-submission\",\"triggerApp\":{\"id\":\"app_X8PhGQ\",\"name\":\"Typeform\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_9NsEGAE1\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-submission-instant-from-jotform-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Submission (Instant) from Jotform API\",\"triggerKey\":\"jotform-new-submission\",\"triggerApp\":{\"id\":\"app_mqehaz\",\"name\":\"Jotform\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_xOsZ1nNY\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-meeting-created-instant-from-zoom-api\",\"title\":\"Convert URL to PDF with HTML to Image API on Meeting Created (Instant) from Zoom API\",\"triggerKey\":\"zoom-meeting-created\",\"triggerApp\":{\"id\":\"app_m5ghAd\",\"name\":\"Zoom\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_Ads2YxXR\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-custom-webhook-events-from-stripe-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Custom Webhook Events from Stripe API\",\"triggerKey\":\"stripe-custom-webhook-events\",\"triggerApp\":{\"id\":\"app_OD5hrX\",\"name\":\"Stripe\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_10se8mY9\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-scheduled-tasks-from-pipedream-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Scheduled Tasks from Pipedream API\",\"triggerKey\":\"pipedream-new-scheduled-tasks\",\"triggerApp\":{\"id\":\"app_13GhYE\",\"name\":\"Pipedream\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_10se8y0m\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-incoming-sms-instant-from-twilio-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Incoming SMS (Instant) from Twilio API\",\"triggerKey\":\"twilio-new-incoming-sms\",\"triggerApp\":{\"id\":\"app_mE7hqO\",\"name\":\"Twilio\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_WLsRyeWo\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-download-counts-from-npm-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Download Counts from npm API\",\"triggerKey\":\"npm-download-counts\",\"triggerApp\":{\"id\":\"app_XywhLL\",\"name\":\"npm\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_ZGsKeeme\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-stories-by-keyword-from-hacker-news-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Stories by Keyword from Hacker News API\",\"triggerKey\":\"hacker_news-new-stories-by-keyword\",\"triggerApp\":{\"id\":\"app_OrZhP7\",\"name\":\"Hacker News\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_e9sByNa0\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-upcoming-event-alert-from-google-calendar-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Upcoming Event Alert from Google Calendar API\",\"triggerKey\":\"google_calendar-upcoming-event-alert\",\"triggerApp\":{\"id\":\"app_13Gh2V\",\"name\":\"Google Calendar\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_yqs5WBoL\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-row-from-snowflake-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Row from Snowflake API\",\"triggerKey\":\"snowflake-new-row\",\"triggerApp\":{\"id\":\"app_mWnh8j\",\"name\":\"Snowflake\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_VysqBbzg\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-activity-created-event-from-strava-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Activity Created Event from Strava API\",\"triggerKey\":\"strava-activity-created\",\"triggerApp\":{\"id\":\"app_XKvh3R\",\"name\":\"Strava\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_R7s42N0Y\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-form-submission-from-webflow-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New Form Submission from Webflow API\",\"triggerKey\":\"webflow-new-form-submission\",\"triggerApp\":{\"id\":\"app_mn5hvG\",\"name\":\"Webflow\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_NOsx7gX9\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-account-created-from-zoom-admin-api\",\"title\":\"Convert URL to PDF with HTML to Image API on Account Created from Zoom Admin API\",\"triggerKey\":\"zoom_admin-account-created\",\"triggerApp\":{\"id\":\"app_13GhxE\",\"name\":\"Zoom Admin\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_9NsEGAze\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-new-file-from-dropbox-api\",\"title\":\"Convert URL to PDF with HTML to Image API on New File from Dropbox API\",\"triggerKey\":\"dropbox-new-file\",\"triggerApp\":{\"id\":\"app_XGehk1\",\"name\":\"Dropbox\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"},{\"id\":\"int_pQsOgR3W\",\"slug\":\"convert-url-to-pdf-with-html-to-image-api-on-card-moved-instant-from-trello-api\",\"title\":\"Convert URL to PDF with HTML to Image API on Card Moved (Instant) from Trello API\",\"triggerKey\":\"trello-card-moved\",\"triggerApp\":{\"id\":\"app_168hnX\",\"name\":\"Trello\",\"__typename\":\"App\"},\"actionKey\":\"html_to_image-convert-url-to-pdf\",\"actionApp\":{\"id\":\"app_dBhwjL\",\"name\":\"HTML to Image\",\"__typename\":\"App\"},\"__typename\":\"Integration\"}],\"__typename\":\"IntegrationConnection\"}}}","hasNext":false}}
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
html_to_image: {
type: "app",
app: "html_to_image",
}
},
async run({steps, $}) {
const data = {
"html_content" : "<div class=\"mt-4 p-4 text-center\"style=width:500px><span class=\"mb-4 tweet-text\">This is Little Bear. He tolerates baths because he knows how phenomenal his floof will appear afterwards. 13/10</span><div class=\"mt-2 p-4\"><img class=\"mt-4 border rounded-circle shadow\"src=https://docs.htmlcsstoimage.com/assets/images/dog.jpg width=100px></div><h4 class=mt-2>WeRateDogs</h4><span class=text-muted>@dog_rates</span></div><link href=https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css rel=stylesheet crossorigin=anonymous integrity=sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk><link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@700\"rel=stylesheet>",
"css_content" : ".tweet-text{background-color:#fff2ac;background-image:linear-gradient(to right,#ffe359 0,#fff2ac 100%);font-weight:bolder;font-size:32px;font-family:Roboto,sans-serif;padding:4px}",
"generate_img_url": true
}
return await axios($, {
method: "post",
url: `https://api.htmlcsstoimg.com/api/v1/generateImage`,
headers: {
"CLIENT-API-KEY": `${this.html_to_image.$auth.api_key}`,
},
data,
})
},
})
Create an image from HTML. See the documentation
Create a PDF file from HTML. See the documentation
Capture a screenshot from a URL. See the documentation
Create a PDF from a URL. See the documentation
HTML to Image uses API keys for authentication. When you connect your HTML to Image account, Pipedream securely stores the keys so you can easily authenticate to HTML to Image APIs in both code and no-code steps.