Add a PDF viewer and a Convert to PDF button to your website
This page is for site owners and developers who want Hemen Dönüştür tools on their own site. There are two products: an embeddable viewer that shows a PDF inside your page, and a button that takes your visitor to the conversion tool you choose. Both are free, need no account, and the configurator below gives you a ready snippet in a few clicks.
Build your snippet
Change the options and the snippet updates right away. Copy it and paste it into your page.
The address must start with https://. Leave it empty to use the postMessage example.
The preview opens the PDF at the address you entered on this page. If the address does not allow CORS, the viewer shows the error.
Embeddable PDF viewer
The viewer is added to your page as an iframe and opens the PDF in the visitor's browser. Page scrolling, jump to page, fit width or page, zoom from 50 to 400 percent, thumbnails, text search, download and print are built in. Scripts inside the PDF are never run; password-protected PDFs open after the visitor types the password.
The simplest option is to pass the PDF address in the file parameter. The visitor's browser downloads the file, so the address must start with https and the server hosting the file must allow other sites to read it (CORS). For your own files, an Access-Control-Allow-Origin header on your server is enough. Otherwise the viewer shows a clear error. Files can be up to 100 MB and the address up to 2048 characters.
<iframe src="https://hemendonustur.com/embed/pdf-viewer?file=https%3A%2F%2Fexample.com%2Fcatalog.pdf&lang=en" title="PDF viewer" width="100%" height="640" style="border:0" loading="lazy" allow="fullscreen"></iframe>Viewer parameters
- file: the https address of the PDF (URL encoded). Without it, the viewer waits for a file sent with postMessage.
- page: the page shown on open, for example page=3.
- zoom: width (fit width, default), page (fit page) or a percentage from 50 to 400.
- toolbar: 0 hides the toolbar so only the pages are shown.
- download: 0 hides the download and print buttons.
- lang: interface language, tr or en. Without it, the visitor's browser language is used.
- theme: light or dark. Without it, the visitor's system theme is followed.
Sending the file with postMessage
If the PDF is not at a public address, or you cannot set CORS, you can send the file from your page straight to the viewer. When the viewer has loaded, it posts an hd-pdf-ready message to the parent window. You then send the file bytes as { type: "hd-pdf-open", data, name }, where data is an ArrayBuffer or a Uint8Array. You get hd-pdf-loaded back (with the page count) when the document opens, or hd-pdf-error (with a fixed code) if something fails. To ask later whether the viewer is ready, send hd-pdf-ping.
The viewer only listens to messages from its own parent window and ignores messages it does not recognise. Use https://hemendonustur.com as the target origin when posting. The postMessage example in the configurator covers all of these steps.
Privacy
- Viewer: the PDF opens in the visitor's browser and is not sent to our server. A file in the file parameter is fetched by the visitor's browser directly from your server.
- The viewer has no cookies, ads or analytics tags. Only a cookieless counter records that the viewer was opened and the domain of the site embedding it; no file name or content is recorded.
- The button is just a link: it collects no data on your site and sets no cookies. On click, your domain is added as a ref parameter and our page counts only that domain.
Terms of use
- The viewer and the button are free, including on commercial websites.
- The Hemen Dönüştür link under the viewer and the button must stay visible and uncovered.
- They must not be used to show unlawful or misleading content or content that infringes the rights of others. In case of abuse, such as heavy automated traffic, we may rate-limit or block a site.
- The service is provided as is. We announce changes on this page; versioned script files never change.
Frequently asked questions
Do the viewer and the button cost anything?
No, both are free and need no account. The only condition is that the Hemen Dönüştür link under the viewer and the button stays visible.
Is the PDF I embed uploaded to your server?
No. The PDF opens in the visitor's browser. A file given in the file parameter is fetched by the browser directly from its host, and a file sent with postMessage stays in the browser too.
Why does the viewer say "The PDF could not be downloaded"?
Most likely the server hosting the file does not allow other sites to read it (CORS). Add an Access-Control-Allow-Origin header for the file or send it with postMessage. Also check that the address uses https and the file is under 100 MB.
How do I add it to WordPress or another site builder?
Paste the copied iframe or script code into your page editor's custom HTML block. On builders that block scripts, the viewer iframe still works.
Can I change how the button looks?
Yes. Choose light or dark with data-theme, small, medium or large with data-size, and write your own text of up to 40 characters with data-label. The ::part(button) CSS selector allows finer changes.
What does the integrity value in the snippet do?
It is an SRI hash. The browser checks that the script it downloads matches this value exactly and does not run it if the file has been altered. The version 1 file never changes, so neither does the hash.

