PDF 페이지 내용 크기 조정

PDF 페이지 내용 크기 조정

Java 샘플은 1페이지와 3페이지의 콘텐츠 영역 크기를 조정하고 부울 반환 값을 확인합니다.

단계

  1. PdfFileEditor 인스턴스를 생성하세요.
  2. 콘텐츠 크기를 조정해야 하는 페이지를 선택하세요.
  3. 대상 너비와 높이를 사용하여 resizeContents을 호출하세요.
  4. 계속하기 전에 반환 값을 확인하고 실패를 처리하세요.
  5. 업데이트된 문서를 저장하세요.

Java 예제```java

public static void resizePdfPageContents(Path inputFile, Path outputFile) { PdfFileEditor pdfEditor = new PdfFileEditor(); if (!pdfEditor.resizeContents(inputFile.toString(), outputFile.toString(), new int[] {1, 3}, 400, 750)) { throw new IllegalStateException(“Failed to resize PDF page contents.”); } }