# How to watermark EPUB ebooks you sell on Shopify (/guides/watermark-epub-ebooks)

A PDF stamp sits at a fixed spot on a fixed page. An EPUB has no fixed pages. The reading app reflows the text to fit the screen, the font size and the reader's settings, so a line of text laid over "page 1" has nowhere to stay. Watermarking an EPUB means adding to the book itself instead: a page that names the buyer, codes in the book's metadata, and marks hidden in the text.

This approach is often called social DRM. It makes each copy personal, so sharing it means sharing the buyer's name, and it gives you a way to identify a copy that turns up online. Anyone can still open and copy the book.

## Social DRM vs hard DRM [#social-drm-vs-hard-drm]

Hard DRM, such as Adobe's or Amazon's, encrypts the book so it only opens in approved apps signed in to the buyer's account. It stops casual copying, but it costs the honest buyer too. They need a particular app and account, they can't always move the book between devices, and the book can stop opening if the account or the service goes away. Selling encrypted EPUBs from your own store also means signing up with a DRM provider.

Social DRM leaves the book open. Your buyer reads it in Apple Books, Kobo, Google Play Books, Thorium or any other EPUB app, on as many devices as they own. In exchange, anyone determined enough can remove the marks they find. That's why it helps to use more than one kind of mark, so removing one leaves the others in place.

## Three places to mark an EPUB [#three-places-to-mark-an-epub]

### A licence page [#a-licence-page]

A page in the book that says who the copy is licensed to: their name, email address, order number and date, and often a licence code. It's the EPUB version of a visible stamp, and it does the same job of discouraging casual sharing. A buyer who sees their own name inside the book thinks twice before dropping it into a group chat.

Put it straight after the cover, where every reader passes it. At the end of the book it's less in the way, but fewer people see it.

Its weakness is that it's a separate page. Anyone with an ebook editor, such as Sigil or the editor built into Calibre, can delete it in a few minutes.

### The metadata [#the-metadata]

Every EPUB carries metadata: the title, the author, the language and identifiers, kept in a file inside the book. Reading apps show the title and author in the reader's library and ignore most of the other fields, so a copy code saved there stays out of sight while the book is read.

Anyone who opens the book in Calibre or an editor can see the metadata, though, and converting the book often rewrites it.

### Hidden marks in the text [#hidden-marks-in-the-text]

Unicode has characters that take up no space, such as the zero-width space. Placed between words, they don't change how the text looks or wraps, and reading apps don't show them. A sequence of them can spell out a code. A code can also go in a comment inside one of the book's stylesheets, which readers never see.

These are the marks most likely to survive when someone deletes the licence page and cleans up the metadata. They can still be lost. A tool that strips invisible characters removes them, and someone comparing copies from two different buyers can spot what differs between the files.

## What survives editing and conversion [#what-survives-editing-and-conversion]

No mark is impossible to remove. What survives depends on what the leaker does to the book:

- **Deleting the licence page** removes the buyer's name from view. The metadata and the hidden marks elsewhere in the book stay where they are.
- **Converting EPUB to EPUB with Calibre** kept the hidden characters in our tests of Imprint's marks, so the converted book could still be traced. It dropped the stylesheet comment and the copy code in the metadata.
- **Converting EPUB to PDF** removed every hidden mark in the same tests.
- **Screenshots, photos and retyping** keep only what's visible on screen, so hidden marks don't come along.

So a leaker who knows what to look for can produce a clean copy. One who only deletes the licence page, or converts the book to another EPUB, leaves the hidden characters behind.

### What about Kindle files? [#what-about-kindle-files]

Kindle formats such as MOBI and AZW3 are different files from EPUBs, and Imprint sends them unchanged. If you sell to Kindle readers, you can sell them the EPUB instead, as Amazon's Send to Kindle accepts EPUB files and converts them for the reader's Kindle. The conversion happens on Amazon's servers, so don't count on the hidden marks coming through it.

## How to watermark EPUBs with Imprint on Shopify [#how-to-watermark-epubs-with-imprint-on-shopify]

Imprint adds a licence page to each EPUB as your customer downloads it, so every copy names its own buyer. It's on every plan, including Free.

1. **Attach the EPUB to your product.** Open the product in Imprint and upload the file, as you would a PDF. The [managing products docs](/docs/product) cover the details.
2. **Check that watermarks are on.** The licence page follows the watermark switches in **Watermark Settings**: it's only added while **Enable watermark** and **Apply to all PDFs** are on, and never on a product whose watermark is disabled.
3. **Switch on Stamp EPUB files** and save. It starts off for every store, so no EPUB changes until you turn it on.
4. **Choose where the page goes:** **After the cover** (the default) or **At the end of the book**. Fixed-layout books, such as picture books and comics, always get the page at the end, so their two-page spreads stay as they are. You can also list the page in the book's table of contents; it's left out by default.
5. **Write your own licence text** (Basic plan and up). Each line becomes a paragraph of the page. You can use the same variables as the PDF watermark, up to 1,000 characters in all. The **Licence page preview** under the field shows the result with sample values. For example:

   ```
   Licensed to {name}
   {email}
   Order {order_number}, {date}
   Copy {copy_id}
   Please don't share it.
   ```

   A line whose values are all missing is left out. Leave the field empty to use the default text, which each customer gets in the language of their order.
6. **Switch on tracing marks** (Premium). They hide the copy code in the text of up to five chapters spread through the book, in a stylesheet comment, and in the metadata. They're added even on books without a licence page, as long as **Stamp EPUB files** is on. The [tracing marks docs](/docs/tracing-marks#in-epub-files) explain each one.
7. **Place a test order.** Download the EPUB and open it in the reading apps your customers use. Check that the licence page is where you put it and reads the way you want.

### What each plan adds [#what-each-plan-adds]

- **Free:** a licence page with the default text, in the customer's language. Free has no [copy tracking](/docs/copy-tracking), so the page has no licence code and the metadata gets no codes.
- **Basic:** your own licence text, and the order's licence code and the download's copy code saved in the book's metadata. Any code leads back to its order through **Find Order by Code**.
- **Premium:** the hidden marks in the text and stylesheet, and [leak tracing](/leak-tracing) that reads them back from a leaked copy.

### What Imprint leaves alone [#what-imprint-leaves-alone]

Your chapters, images and fonts stay as you uploaded them. Imprint only adds the licence page, the metadata codes on paid plans and the hidden marks on Premium. It sends these files unchanged:

- **Books with DRM**, as their content is encrypted. Font obfuscation, which many EPUBs use for their embedded fonts, isn't DRM and doesn't get in the way.
- **Kindle files** such as MOBI and AZW3.
- **Files named `.epub` that aren't EPUBs.**

The marks never block a download. If Imprint can't add them to a book, your customer gets the book without them. The [EPUB section of the watermark settings docs](/docs/watermark-settings#epub-files) has the full list of settings.

## If one of your EPUBs leaks [#if-one-of-your-epubs-leaks]

1. **Save the file exactly as you found it.** Don't open it in Calibre and save it again, or convert it first. As the tests above show, conversion can drop the stylesheet comment and the metadata.
2. **Open it and look for the licence page**, after the cover and at the end. If it's there, it tells you whose copy it was.
3. **Check for codes.** An EPUB is a ZIP archive. Make a copy, rename it from `.epub` to `.zip` and open it. The metadata is in the file ending in `.opf`, and the chapters are HTML files you can search for a code or an email address. The hidden characters won't show up this way, but leak tracing reads them. With Imprint's Basic plan or higher, type any copy code or licence code you find into **Find Order by Code** on the Orders page.
4. **Upload it to Leak tracing** (Premium). Imprint reads the text of every chapter, the book's metadata and its stylesheets, and compares every clue with your store's orders. The result calls the metadata the document properties and counts each chapter as a page. A matching copy code, or the order's licence code in the metadata, gives a **High confidence** match.
5. **Check the match, then act.** A match tells you whose copy was shared. It doesn't prove that person shared it. From the result you can restrict the order's downloads and draft a takedown notice.

If the leaked file is a PDF made from your EPUB, the hidden marks are most likely gone, so leak tracing may find no match. You can still get the copies removed, because a takedown notice only has to identify your work and where the copies are.

[How to find out who leaked your PDF](/guides/find-who-leaked-your-pdf) walks through checking a match and contacting the customer, and most of it applies to ebooks too. [How to send a DMCA takedown notice](/guides/dmca-takedown-notice) covers getting the copies taken down.

## Tell buyers the book is personalised [#tell-buyers-the-book-is-personalised]

Buyers see the licence page when they open the book. Say it on the product page too, so they know before they buy. A line like "Each copy is personalised with the buyer's name and order details" is enough. If you use hidden marks, you can add that each copy carries marks that identify its order. That tells buyers the book is traceable without telling them where the marks are.

For how visible and hidden marks compare in PDFs, read [Visible vs invisible PDF watermarks](/guides/visible-vs-invisible-watermarks). If you sell PDFs alongside your ebooks, [How to sell PDFs on Shopify and limit sharing](/guides/sell-pdfs-on-shopify) covers setting up the rest of your store.
