PDFkind
Developer docs: Angular

Upload helper

Angular

Reduce PDFs and photos before upload in an Angular app, with one attribute on your file input.

Add the script to src/index.html, then the attribute to your input. Your (change) handler receives the reduced file.

src/index.html
<script src="https://pdfkind.com/embed.js" defer></script>

File input

component.html
<input type="file" data-pdfkind-max="5MB" (change)="onFile($event)" />
component.ts
onFile(event: Event) {
  const file = (event.target as HTMLInputElement).files?.[0];
  if (file) this.upload(file);   // the reduced file
}

Calling it yourself

TypeScript
declare global { interface Window { PDFkind: { fit(f: File, o: { max: string | number }): Promise<File> } } }

const small = await window.PDFkind.fit(file, { max: '5MB' });

Last updated November 3, 2026 · Questions: contact@pdfkind.com