문제 해결

문제 해결

문제 해결

Aspose.PDF FOSS for .NET 작업 시 흔히 발생하는 문제와 해결책


문서 로드

ProblemCauseSolution
Document.Open이(가) 유효한 PDF에서 발생함파일이 비밀번호로 보호됨생성자에 비밀번호를 제공하십시오
대용량 PDF에서 메모리 부족전체 파일을 바이트 배열로 로드함페이지를 개별적으로 처리하거나 스트리밍을 사용하십시오
Pages[0]이(가) 인덱스 오류를 발생시킴페이지가 1 기반 인덱싱을 사용함첫 페이지에 Pages[1]을(를) 사용하십시오

주석

ProblemCauseSolution
저장 후 주석이 보이지 않음사각형의 면적이 0이거나 페이지 경계 밖에 있음좌표가 페이지 내에 있는지 확인하십시오 MediaBox
LinkAnnotation.Uri 반환값이 null링크가 GoTo 또는 JavaScript 동작을 사용함PdfAction.Create 로 해결하고 ActionType 를 확인하십시오
Flatten() 예외 발생주석에 /P (페이지) 참조가 없음주석이 Page.Annotations 를 통해 추가되었는지 확인하십시오

텍스트 추출

ProblemCauseSolution
Extracted text is garbledNon-standard encoding or CID font mappingCheck font embedding; scanned PDFs may need OCR
No text fragments foundPage content is a raster imageUse OCR before text extraction
Regex returns no matchesPDF text layout inserts whitespaceUse a looser pattern or normalize whitespace

렌더링 및 변환

ProblemCauseSolution
Rendered image is blurryResolution too lowIncrease DPI in Resolution constructor
HTML output missing imagesExternal image paths not configuredUse HtmlSaveOptions with embedded images
PDF/A conversion removes annotationsTarget profile disallows annotationsUse PDF/A-2 or PDF/A-3

폼 필드

ProblemCauseSolution
Field value is emptyField has no /V entryCheck field.Value is not null
FillField has no effectField name mismatchUse Form.FieldNames to list available names
ExportToJson produces empty outputWidget annotation not correctly castVerify the annotation is a WidgetAnnotation

일반 팁

  • 파일 핸들을 해제하려면 항상 Documentusing으로 감싸십시오.
  • 파일 잠금을 방지하기 위해 인메모리 워크플로에 Document.Open(byte[])을 사용하십시오.
  • 인덱스로 페이지에 접근하기 전에 doc.Pages.Count을 확인하십시오.
  • 최상의 성능을 위해 모든 수정 후에 문서를 한 번만 저장하십시오.

참조

 한국어