필터 지우기
필터 지우기

How to find out number of pages in a PDF file?

조회 수: 21 (최근 30일)
Kevin
Kevin 2022년 3월 15일
답변: Sivakumar Kaliyappan 2024년 1월 9일
I use the matlab function extractFileText( ) (from the Text Analytics Toolbox) to read PDF file.
But how do I find out number of pages in a PDF file?

채택된 답변

Christopher Creutzig
Christopher Creutzig 2023년 10월 18일
pdfinfo returns this information, starting in 23a.

추가 답변 (2개)

Richard Quist
Richard Quist 2022년 4월 30일
I don't know of anything built into MATLAB that would provide this. It's possible you could write a batch file/shell script to do this for you using an external tool like pdftk, ghostscript, or qpdf.

Sivakumar Kaliyappan
Sivakumar Kaliyappan 2024년 1월 9일
filename = "file_Name.pdf";
info = pdfinfo(filename)
info = struct with fields:
NumPages: 5
PageSize: [47×4 double]
PDFVersion: "1.6"
Title: ""
Subject: ""
Language: "en-GB"
Keywords: ""
Author: "William Shakespeare"
Creator: "Microsoft® Word 2013"
Producer: "Microsoft® Word 2013"
CreationDate: 21-Jul-2017 11:53:33
ModificationDate: 28-Sep-2022 17:30:37
Encrypted: 0
AllowsTextExtraction: 1
Filename: "C:\TEMP\exampleSonnets.pdf"
This is possible on R2023a or b
If you do not have R2023b use MATLAB online

카테고리

Help CenterFile Exchange에서 Text Data Preparation에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by