Make a flipbook from images: JPG, PNG or WebP instead of a PDF
Photos, scans and exported pages can become a flipbook without a PDF. When images are the better choice, which sizes and formats to use, and what you give up.

Not every site runs on WordPress, Shopify or Wix. A static site, a web app or a custom CMS can show the same flipbook with the Real3D Flipbook JavaScript library: a folder of files on your server and a few lines of code. It has no dependencies, so it works with plain HTML, React, Vue or anything else that renders a page.
This guide uses version 5.7 of the library. The full option list is in the JavaScript documentation.
The download from CodeCanyon has three folders: build with the minified files for production, examples with ready-made HTML pages, and src with the unminified source. Copy the contents of build to your site, then add the stylesheet and the script to the page:
<link rel="stylesheet" href="css/flipbook.style.css">
<script src="js/flipbook.min.js"></script>Add an empty element where the book should go, and create the flipbook when the page has loaded:
<div id="catalog"></div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const container = document.getElementById("catalog");
new FlipBook(container, {
pdfUrl: "pdf/catalog.pdf"
});
});
</script>That is a working flipbook, with the realistic 3D page turn, the toolbar, zoom, thumbnails and search. If the PDF has bookmarks, they become the table of contents.
Use pages instead of pdfUrl, with one image per page and an optional thumbnail:
new FlipBook(container, {
pages: [
{ src: "book/1.jpg", thumb: "book/thumb1.jpg", title: "Cover" },
{ src: "book/2.jpg", thumb: "book/thumb2.jpg" },
{ src: "book/3.jpg", thumb: "book/thumb3.jpg", title: "Chapter 1" }
]
});Pages with a title appear in the table of contents. Keep images around 1500 to 2000 pixels high, as JPG or WebP. Make a flipbook from images explains when images are a better choice than a PDF.
A flipbook in the page starts loading straight away. Behind a button, it loads nothing until someone opens it, which keeps the page fast, especially with several books on one page. Pass the button as the element and turn on lightBox:
<button id="read-catalog">Read the catalog</button>
<script>
new FlipBook(document.getElementById("read-catalog"), {
pdfUrl: "pdf/catalog.pdf",
lightBox: true
});
</script>Any element works: an image of the cover, a link or a card.
Set a prefix, and every page gets its own address:
deeplinkingPrefix: "catalog_"https://example.com/#catalog_12 now opens the book on page 12, and opens the lightbox first if the flipbook is in one. That is handy in newsletters and support replies. Navigating a long flipbook has more ideas.
Anything in mobile overrides the main options on phones. A common setup keeps the 3D page turn on desktop and shows one page at a time with swipe on phones:
new FlipBook(container, {
pdfUrl: "pdf/catalog.pdf",
viewMode: "webgl",
mobile: {
viewMode: "swipe",
singlePageMode: true
}
});viewMode can be webgl, 3d, 2d, swipe, scroll or simple. Which flipbook view mode to use compares them.
It works on the server, not on my computer. Browsers block a page opened from a file (file://) from loading the PDF. Run a local web server instead, or test on the real site.
The PDF is on another domain. By default the PDF or images must come from the same domain as the page. To load them from a CDN or storage bucket, the server that holds them has to send an Access-Control-Allow-Origin header for your site. If nothing shows, the browser console usually says which of the two it is.
While you are on the server: make sure it supports range requests, so the flipbook can show the first pages before the whole PDF has arrived. Why a flipbook loads slowly covers that and the PDF itself.
The JavaScript library is sold on CodeCanyon. The regular license is $99, paid once, with future updates and six months of support. You activate it for the domain where it runs at verify.real3dflipbook.net, signing in with your Envato account.
No. new FlipBook(element, options) works without any other library. Older code that calls jQuery("#container").flipBook(options) still works too.
Yes. Create the flipbook after the component has rendered its container element, for example in useEffect in React or mounted in Vue.
Yes. Set googleAnalyticsTrackingCode to your GA4 measurement ID, starting with G-. The events are the same as in the WordPress plugin, listed in flipbook analytics.
Export the PDF for screen, with images at about 150 dpi, and save it as a web-optimized (linearized) PDF. For the fastest loading, a separate converter turns the PDF into page images and data, so the browser doesn’t need to load the PDF at all, while search and links keep working.
Yes. The WordPress plugin, the Shopify and Wix apps and the JavaScript library show books with the same viewer. The plugin and apps add an admin screen, and the JavaScript library gives you the options in code.
Photos, scans and exported pages can become a flipbook without a PDF. When images are the better choice, which sizes and formats to use, and what you give up.
Two ways to put a flipbook on an Elementor page. The Shortcode widget costs nothing, the addon gives you a widget with live preview. Plus how to open the book from your own button.
How many people opened the catalog, how far they got, and which products they clicked. The events a flipbook sends to Google Analytics 4, and how to turn them into a report.
Catalogs, magazines and brochures with a realistic page flip, on WordPress, Shopify, Wix or any website.