Developer docs: Code generator
Get started
Code generator
Pick a size limit, a tool and a language, and copy ready-to-paste code with a live preview.
The code updates as you change the options. Copy it into your page; nothing else is needed.
Shrink uploads before they fail
Add data-pdfkind-max to a file field. When a visitor picks a PDF or photo that is too big, PDFkind reduces it in their browser and your form receives the smaller file. iPhone photos (HEIC) are turned into JPG.
HTML
<script src="https://pdfkind.com/embed.js" defer></script>
<input type="file" name="document" data-pdfkind-max="5MB">
<p>Large files are reduced in your browser by <a href="https://pdfkind.com/compress-pdf">PDFkind</a>.</p>Or from your own code:
JavaScript
const small = await PDFkind.fit(file, { max: '5MB' });Put a full tool on your page
Any tool, in any language, sized to fit your page automatically.
HTML
<div data-pdfkind-tool="merge-pdf"></div>
<script src="https://pdfkind.com/embed.js" defer></script>
<p><a href="https://pdfkind.com/merge-pdf">Merge PDF</a> by PDFkind</p>Preview
Last updated November 3, 2026 · Questions: contact@pdfkind.com