Documentación para desarrolladores: Angular
Asistente de subida
Angular
Reduce PDF y fotos antes de subirlos en una aplicación Angular, con un solo atributo en tu campo de archivo.
Añade el script a src/index.html y el atributo a tu campo de archivo. Tu manejador (change) recibe el archivo reducido.
src/index.html
<script src="https://pdfkind.com/embed.js" defer></script>Campo de archivo
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); // el archivo reducido
}Llamarlo tú mismo
TypeScript
declare global { interface Window { PDFkind: { fit(f: File, o: { max: string | number }): Promise<File> } } }
const small = await window.PDFkind.fit(file, { max: '5MB' });Última actualización: 3 de noviembre de 2026 · ¿Preguntas? contact@pdfkind.com