Last updated: Nov-09-2022
On this page:
Watch this tutorial to learn how to use the Cloudinary CLI to create a sprite from images in a PDF.
This video is brought to you by Cloudinary's video player - embed your own!
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
Begin with a multi-page PDF.
|0:16||Choose a multi-page PDF from your files.
Upload the PDF to Cloudinary
|0:25||Use the upload command to upload the PDF, specifying its public ID.
Use the explode method to pre-generate each page image
|0:36||Use the explode method to pre-generate images from each page of the PDF. Although not strictly necessary in this context, it does help to speed up the subsequent commands that need the derived images.
Upload an image for each page and apply tags
|0:41||Use the upload command to upload the images derived from each page of the PDF as new images, and apply the tag blue_signs to each.
View each new image
|1:06||Each image has a random public ID. Copy and paste the url to view the image.|
Find assets with the tag 'blue_signs'
|1:16||List the assets with the blue_signs tag to check that no other assets have the same tag, otherwise they would also be included in the sprite.
Generate a sprite from all images with the tag 'blue_signs'
|1:32||Use the CLI command to generate the sprite from the tagged images, and apply a transformation to crop each image to a square.
View the sprite
|1:48||Copy and paste the
View the CSS
|1:57||Copy and paste the
Use the sprite and CSS in a web page
|2:03||Use the CSS classes to display images from your sprite in a web page.|
- Learn more in the Cloudinary CLI Reference.
- Read about the Cloudinary CLI in this blog post.
If you like this, you might also like...
Get Started with the CLISet up the CLI and get familiar with some basic commands
Scripting with the CLIUse a script to create an animated GIF
Upload with the CLIApply background removal to images on upload
Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.