Skill level: Intermediate
Time required: 5 minutes
This article demonstrates the conversion of HTML/CSS code into an image using the HTML/CSS (HCTI) API.
Prerequisites
- A Quickwork account and and familiarity with the platform's GUI.
Step-bystep guide
Configuring the trigger
- In the Event section, choose the Scheduler by Quickwork app from the drop-down menu in the Apps field.
- Select the trigger event as New scheduled event from the drop-down menu in the Triggers field.
- Set the Interval as per your choice based on how often you want the journey to run.
- Set the date and time of your choice in the Start at field and keep the Custom payload field empty.
- No authorization is required as this is an app created by Quickwork.
Passing the HTML and CSS script to convert into an image
- In the Steps section, click on the Simple Action button and choose the HTML/CSS to Image (HCTI) API app from the drop-down menu in the Apps field.
- Select the Create image action from the drop-down menu of the Actions field.
- Click on the Link an account button to establish a connection.
- A connection window will appear, asking for the User ID and API Key of your HTML/CSS to Image (HCTI) API account.
- Once all the required inputs have been specified, click on the Link account button. Your HTML/CSS to Image (HCTI) API account will get connected successfully.
- In the HTML field, enter your HTML code for the image you want to create.
- In the CSS field, enter the CSS code for the Image you want to create.
- Optionally, you can configure the following additional fields as needed, such as Google fonts, URL, Viewport width, Viewport Height, and Delay.
Executing the journey
-
Save the journey by clicking the Save & Start button.
-
The journey will automatically redirect to the History tab.
-
In the Steps section:
- Expand the action bar to view the Input block, which displays the inputs provided.
- Check the Output block for the response received from the API. The output will contain a url for the generated image.
4. Copy the URL and paste it into a new browser tab to view the image.
Your HTML and CSS code has been successfully converted into an image.
Comments
0 comments
Please sign in to leave a comment.