개발자 문서: Angular
업로드 도우미
Angular
Angular 앱에서 파일 입력에 속성 하나만 추가해 업로드 전에 PDF와 사진의 용량을 줄입니다.
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' });최종 업데이트: 2026년 11월 3일 · 문의: contact@pdfkind.com