CloudPDF
DocsPricing
Start building

Put a PDF on your website

In five minutes, your PDF is on your page, in a viewer people can scroll, zoom, search and read on any device. Below is a sample PDF, opened the way your page will open yours. You need a CloudPDF account and a page you can edit. No server, and no code of your own.

1. Upload a PDF#

Sign in to the dashboard, and on Documents, click Upload or drop the file on the page.

The Documents page of the Fernquill Studio workspace, with its folders and PDFs, and the Upload button

CloudPDF keeps the file and gets its pages ready to show. A large PDF takes a few seconds.

2. Make a grant#

A grant lets people open the document without an account. Open the document, then click New grant:

The page of Brand guidelines.pdf: its size and ID, and a Grants card with the New grant button

Give the grant a name you’ll recognize, such as “Website”. The rest is already right for a public page: people can Read the document, its pages show as Images, and it opens Anywhere.

The New grant dialog: named Website, people can Read, and it opens Anywhere

Click Create grant.

3. Paste it into your page#

Choose Embed on a website, and copy the code:

The Grant created dialog, with the embed code for HTML

Put it where the PDF should appear. The script loads the viewer, and its last line opens your grant:

<embedpdf-viewer id="document" style="height: 640px"></embedpdf-viewer>
 
<script type="module">
  import 'https://cdn.jsdelivr.net/npm/@cloudpdf/viewer@3/dist/cloudpdf.js';
 
  document.getElementById('document').src = { grant: 'grt_4n0hW2ubtHdYCRnkwu8My8Pb' };
</script>

The viewer fills the box you give it, so give it a height. Open your page, and the PDF is there.

In React, Vue, Svelte or Angular#

The grant opens the same way in the viewer component for your framework. Install it:

npm install @cloudpdf/viewer-react

Then give it the grant. The dialog has this code too, with your grant in it:

import { PDFViewer } from '@cloudpdf/viewer-react';
 
export function BrandGuidelines() {
  return <PDFViewer src={{ grant: 'grt_4n0hW2ubtHdYCRnkwu8My8Pb' }} style={{ height: 640 }} />;
}

A grant that opens Anywhere has a link of its own. Send it in an email or a chat, and the document opens full screen:

The Grant created dialog, with the grant's link to copy

Change it whenever you like#

A grant keeps working until you pause it or end it, or until it expires. From its menu on the document’s page, you can:

  • let people do more: Comment, Download or Print;
  • ask for a passphrase, or let the grant expire on a date;
  • pause it, and resume it;
  • end it: its link and every page that embeds it stop opening at once, and a viewer already open stops within 10 minutes.

Every page that embeds the grant follows on its next visit, so you never touch your code again.

Next steps#