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

🕹️ Retro Consoles Worth Collecting While You Still Can — Is Last Year's Flagship Phone Worth Your Money?

Saturday, November 23, 2024

Also: Best Outdoor Smart Plugs, and More! How-To Geek Logo November 23, 2024 Did You Know After the "flair" that servers wore—buttons and other adornments—was made the butt of a joke in the

JSK Daily for Nov 23, 2024

Saturday, November 23, 2024

JSK Daily for Nov 23, 2024 View this email in your browser A community curated daily e-mail of JavaScript news React E-Commerce App for Digital Products: Part 4 (Creating the Home Page) This component

Not Ready For The Camera 📸

Saturday, November 23, 2024

What (and who) video-based social media leaves out. Here's a version for your browser. Hunting for the end of the long tail • November 23, 2024 Not Ready For The Camera Why hasn't video

Daily Coding Problem: Problem #1617 [Easy]

Saturday, November 23, 2024

Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Microsoft. You are given an string representing the initial conditions of some dominoes.

Ranked | The Tallest and Shortest Countries, by Average Height 📏

Saturday, November 23, 2024

These two maps compare the world's tallest countries, and the world's shortest countries, by average height. View Online | Subscribe | Download Our App TIME IS RUNNING OUT There's just 3

⚙️ Your own Personal AI Agent, for Everything

Saturday, November 23, 2024

November 23, 2024 | Read Online Subscribe | Advertise Good Morning. Welcome to this special edition of The Deep View, brought to you in collaboration with Convergence. Imagine if you had a digital

Educational Byte: Are Privacy Coins Like Monero and Zcash Legal?

Saturday, November 23, 2024

Top Tech Content sent at Noon! How the world collects web data Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, November 23, 2024? The HackerNoon

🐍 New Python tutorials on Real Python

Saturday, November 23, 2024

Hey there, There's always something going on over at Real Python as far as Python tutorials go. Here's what you may have missed this past week: Black Friday Giveaway @ Real Python This Black

Re: Hackers may have stolen everyone's SSN!

Saturday, November 23, 2024

I wanted to make sure you saw Incogni's Black Friday deal, which is exclusively available for iPhone Life readers. Use coupon code IPHONELIFE to save 58%. Here's why we recommend Incogni for

North Korean Hackers Steal $10M with AI-Driven Scams and Malware on LinkedIn

Saturday, November 23, 2024

THN Daily Updates Newsletter cover Generative AI For Dummies ($18.00 Value) FREE for a Limited Time Generate a personal assistant with generative AI Download Now Sponsored LATEST NEWS Nov 23, 2024