وثائق المطورين: Angular
مساعد الرفع
Angular
صغّر ملفات PDF والصور قبل الرفع في تطبيق Angular، بسمة واحدة على حقل الملف.
أضف البرنامج النصي إلى src/index.html، ثم السمة إلى حقل الإدخال. يتلقى المعالج (change) الملف المصغّر.
src/index.html
<script src="https://pdfkind.com/embed.js" defer></script>حقل ملف
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); // الملف المصغّر
}الاستدعاء بنفسك
TypeScript
declare global { interface Window { PDFkind: { fit(f: File, o: { max: string | number }): Promise<File> } } }
const small = await window.PDFkind.fit(file, { max: '5MB' });آخر تحديث: 3 نوفمبر 2026 · للأسئلة: contact@pdfkind.com