PDFkind
Documentatie voor ontwikkelaars: Angular

Uploadhulp

Angular

Verklein PDF’s en foto’s vóór het uploaden in een Angular-app, met één attribuut op je bestandsveld.

Voeg het script toe aan src/index.html en daarna het attribuut aan je bestandsveld. Je (change)-handler ontvangt het verkleinde bestand.

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

Bestandsveld

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);   // het verkleinde bestand
}

Zelf aanroepen

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

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

Laatst bijgewerkt op 3 november 2026 · Vragen: contact@pdfkind.com