Web Tools #357 - Screenshot/PDF API, React Tools, Media, Site Builders

Web Tools Weekly
What a Tool!

Issue #357 • May 21, 2020

The following intro is a paid product review for Restpack, a web service for generating screenshots and converting HTML to PDF, both via API calls.

You might have a number of different reasons for automating or programmatically generating screenshots or PDFs in one of your web apps. You may want to generate reports or invoices, or maybe you need to produce dynamic website screenshots via Node, PHP, Python, Ruby, Go, or C#.

 
Restpack


Restpack offers two API services:
 

 

Each API is available using any of the aforementioned technologies, and both services are very easy to use. The rendering engine that these APIs are based on is WebKit and the results are extremely accurate, rendering web fonts, CSS, and dynamic JavaScript-based content with pixel-perfect precision.

Let's first consider the Screenshot API. When you create an account (they offer a 7-day free trial), you can access either service via the Restpack console. You can try out the screenshot API in just a few clicks using the API Explorer, which is pretty cool because it's basically a GUI for testing requests:

 
Restpack's API Explorer
Restpack's API Explorer


As you can see, the service provides you with your own access token (I've disguised mine) that you can use to make an API request using one of the technologies (Node is selected in the screenshot). There's also the ability to add various parameters to the API call, some of which you can see in the bottom-right area of the above screenshot.

It's easy to execute an API call via your terminal using the example Curl command. Here's one that I used to take a screenshot of the Web Tools Weekly home page (again, my access token is removed):
 

curl --request POST --url https://restpack.io/api/screenshot/v6/capture \
     --header 'Content-Type: application/json' \
     --data '{"access_token":"XXXXXXX","json":"true","url":"https://webtoolsweekly.com","format":"png","width":"820"}'
 

You can see the result of that request at this URL, which is produced automatically by Restpack when the request is successful. The result is stored via CDN and is publicly available.

The above code executed a POST request, but I could also execute the same command using a GET request via the following URL:

https://restpack.io/api/screenshot/v6/capture

I would just have to provide any necessary parameters (access_token, json, url, format, width, etc.) by attaching them to the URL as query string values.

Let's now take a look at the HTML to PDF API, which similarly provides an API Explorer along with a whole slew of parameters you can add to the request to customize the look of the PDF.

 
Restpack's HTML to PDF API allows a number of useful parameters
Restpack's HTML to PDF API allows a number of useful parameters
 

One really cool feature is the ability to add CSS to the request to style certain parts of the page (for example, you can send a print stylesheet). I used the service to generate a PDF of one of my lengthy articles on JSON. I added some custom CSS to hide the sidebar, most of the footer, and other areas of the page. You can see the resulting PDF at this location., with all article links intact. You can see how a little CSS wrangling can get you a nicely laid out PDF from any web page.

Both APIs return the raw document by default, but you can specify a JSON parameter to receive a JSON object instead. For example, my request to create the article PDF had the following JSON response:
 

{
  "cached": "false",
  "content-type": "application/pdf",
  "file": "https://storage.restpack.io/pdf/66a32f175749ab84c113f4e4148e97452a2f4c51fe40bf1cffc9e8acfb7a7bd8",
  "height": "20258",
  "image": "https://storage.restpack.io/pdf/66a32f175749ab84c113f4e4148e97452a2f4c51fe40bf1cffc9e8acfb7a7bd8",
  "length": 290578,
  "remote_status": "200",
  "run_time": "3841",
  "url": "https://www.impressivewebs.com/what-is-json-introduction-guide-for-beginners/",
  "width": "733"
}


Once you have this data, you can deal with it as needed. Very useful!

As with the screenshot API, the HTML to PDF API allows you to make either POST or GET requests, with more than two dozen optional parameters you can pass to customize the response.

As mentioned, you can give Restpack a try with their 7-day trial for either service, after which you can choose from a variety of reasonable pricing options.

Now on to this week's tools!
 

React Tools

Recoil
An experimental state management library for React apps that provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

react-circular-input
React components for easily composing a circular range input (i.e. a circular progress indicator).

react-hotkeys-hook
A React hook for using keyboard shortcuts in components.

Kea
Now at version 2+. Production-ready state management for React.

React-Tiny-Link
Convert your links into beautiful previews. A React link preview component with cards for web without a specific backend.

react-select-search
Lightweight select component for React.

React Cool Inview
React hook to monitor when an element enters or leaves the viewport (or when it enters or leaves another element).

useWorker
A React hook that can run expensive background tasks that are non-blocking, with Promises support.

react-pdf-highlighter
A React library built on top of Mozilla's PDF.js that provides annotations for PDF documents on web.

Snuggle
Lightweight React component to create CSS-based masonry-like layouts (i.e. layouts that "snuggle" the elements together tightly).

react-tater
A React component to add annotations to any element on a page.

use-local-storage-state
React hook that persists data in local storage.

React Autosuggest
WAI-ARIA compliant, mobile-friendly, and customizable autosuggest component for React.

Media Tools (SVG, Audio, Video, etc.)

React PIXI
React version of PixiJS, the 2D rendering library for building interactive graphics and games.

Control
100+ illustrations that can be customized via an online constructor to create the specific scene you're looking for.

Draw.io VS Code Integration
Integrates Draw.io (now called diagrams.net), the online drawing tool, into VS Code.

Canvas-Txt
Library to easily render text onto HTML Canvas. The page has a neat little interactive demo to try it out.

Thumbs Up
Upload a YouTube thumbnail and enter your video's title and this tool will show you what it will look like on YouTube in its various formats.

Scrawl-canvas
A JavaScript library for working with the HTML Canvas element, helping to make the Canvas elements responsive, accessible, interactive, and more.

React Leaflet
React components for Leaflet maps (the open-source library for mobile-friendly interactive maps).

midori
Library for animated image backgrounds. Features include a configurable dynamic camera, transitions between backgrounds, and effects.

Podely
Service that converts your YouTube channel into a podcast.

GoJS
JavaScript and TypeScript library for building interactive diagrams and graphs, from simple flowcharts and org charts to highly-specific industrial diagrams, and more.

PIXI.js Playground
A series of examples (forkable and free to use) demonstrating how you can use PixiJS to create interactive experiences.

Peaks.js
JavaScript UI component for interacting with audio waveforms.

Rough Charts
A responsive, composable React charting library with a hand-drawn style.

Static Sites, CMS's, Site Builders, etc.

beluga
Open-source software for creating your own ecommerce site. Built with React and Node, and using Stripe for payment processing.

gatsby-starter-ts
A TypeScript starter template for Gatsby. No plugins or styling, just a bare starting point.

TS LiveView
Enables rich, real-time user experiences with server-rendered HTML. Just like Phoenix LiveView (the Elixir-based framework) but in Typescript.

Ga11ery
A minimal image sharing site kit, built with Eleventy and NetlifyCMS. Ideal for photography, illustration, and web comics.

Eleventy Error Overlay
A pretty error page for development-time Eleventy build problems, to catch errors before going to production.

Adalo
Build database-driven, interactive apps using a drag-and-drop interface with no code.

gatsby-remark-embedder
Gatsby Remark plugin to embed well known services by their URL. For example, CodePen, CodeSandbox, Pinterest, SoundCloud, Twitch, Twitter, etc., can all be embedded via the URL alone, no embed code needed.

Tilda
Create beautiful websites without any code. 450+ pre-designed blocks ready for your web projects.

Slaptrash
Make weird Flash-like text/audio presentations by writing markup. The examples are just plain weird, but it's an interesting little experiment.

A Tweet for Thought

I hope your development experience doesn't feel like this very often.
 

Send Me Your Tools!

Made something? Send links via Direct Message on Twitter @WebToolsWeekly (details here). No tutorials or articles, please. If you have any suggestions for improvement or corrections, feel free to reply to this email.
 

Before I Go...

If you're a bit of a word nerd like me, you might enjoy This Word Does Not Exist (another addition to the 'X does not exist' AI/ML trend) that uses machine learning to make up words and their definitions.

Thanks to everyone for subscribing and reading!

Keep tooling,
Louis
webtoolsweekly.com
@WebToolsWeekly
PayPal.me/WebToolsWeekly

Older messages

Web Tools #356 - CSS Tools, Git/CLI, Static Sites/CMS

Thursday, May 14, 2020

Web Tools Weekly WEB VERSION Issue #356 • May 14, 2020 Promotion 50% Off! Fullstack Advanced React & GraphQL Learn advanced React by building an online store in this excercise-driven video course.

Web Tools #355 - Frameworks, Testing Tools, JS Utilities

Thursday, May 7, 2020

Web Tools Weekly WEB VERSION Issue #355 • May 7, 2020 Promotion 123FormBuilder Gold Plan: Lifetime Subscription For a one-time fee of $39.99 (usually $299.88/year) ‬you get a lifetime subscription to

Web Tools #354 - React Tools, Image/Video Tools, Uncats

Thursday, April 30, 2020

Web Tools Weekly WEB VERSION Issue #354 • April 30, 2020 In previous tips I introduced a basic HTML Drag and Drop API example along with some things you can do with the dataTransfer() object. This tip

Web Tools #353 - Vue Tools, Databases, Mobile Tools

Thursday, April 23, 2020

Web Tools Weekly WEB VERSION Issue #353 • April 23, 2020 The following intro is a paid product review for AnnounceKit, a hosted changelog or product update service that provides a communication channel

Web Tools #352 - CSS Tools, JS Utilities, Build Tools

Thursday, April 16, 2020

Web Tools Weekly WEB VERSION Issue #352 • April 16, 2020 Advertisement via Paved Real-Time Chat at Your Fingertips Stream Chat offers a variety of SDKs and pre-built components to help integrate real-

You Might Also Like

OpenAI search May 9 rumor 🤖, Tesla cuts interns 🚗, building a rocket engine 🚀

Friday, May 3, 2024

Reports indicate that OpenAI is looking to launch a search engine soon. OpenAI's in-house event on May 9 may focus on its release Sign Up |Advertise|View Online TLDR Together With LMNT TLDR 2024-05

Data Science Weekly - Issue 545

Friday, May 3, 2024

Curated news, articles and jobs related to Data Science, AI, & Machine Learning ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

When accelerator dreams become company nightmares

Thursday, May 2, 2024

Plus: Illinois gives Rivian incentives and AI is not SaaS View this email online in your browser By Christine Hall Thursday, May 2, 2024 Hello, and welcome back to TechCrunch PM. We have a great lineup

📱 Issue 409 - Claude Team plan and iOS app

Thursday, May 2, 2024

This week's Awesome iOS Weekly Read this email on the Web The Awesome iOS Weekly Issue » 409 Release Date May 02, 2024 Your weekly report of the most popular iOS news, articles and projects Popular

💻 Issue 415 - Hotel WiFi JavaScript Injection (2012)

Thursday, May 2, 2024

This week's Awesome JavaScript Weekly Read this email on the Web The Awesome JavaScript Weekly Issue » 415 Release Date May 02, 2024 Your weekly report of the most popular JavaScript news, articles

💎 Issue 415 - Choosing the Right Audit Trail Approach in Ruby

Thursday, May 2, 2024

This week's Awesome Ruby Newsletter Read this email on the Web The Awesome Ruby Newsletter Issue » 415 Release Date May 02, 2024 Your weekly report of the most popular Ruby news, articles and

💻 Issue 408 - Speeding up C++ build times

Thursday, May 2, 2024

This week's Awesome .NET Weekly Read this email on the Web The Awesome .NET Weekly Issue » 408 Release Date May 02, 2024 Your weekly report of the most popular .NET news, articles and projects

💻 Issue 415 - Ditch dotenv: Node.js Now Natively Supports .env File Loading

Thursday, May 2, 2024

This week's Awesome Node.js Weekly Read this email on the Web The Awesome Node.js Weekly Issue » 415 Release Date May 02, 2024 Your weekly report of the most popular Node.js news, articles and

💻 Issue 333 - React 19 Beta

Thursday, May 2, 2024

This week's Awesome React Weekly Read this email on the Web The Awesome React Weekly Issue » 333 Release Date May 02, 2024 Your weekly report of the most popular React news, articles and projects

📱 Issue 412 - The Composable Architecture: My 3 Year Experience

Thursday, May 2, 2024

This week's Awesome Swift Weekly Read this email on the Web The Awesome Swift Weekly Issue » 412 Release Date May 02, 2024 Your weekly report of the most popular Swift news, articles and projects