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

11 vues (au cours des 30 derniers jours)
Kevin
Kevin le 15 Mar 2022
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?

Réponse acceptée

Christopher Creutzig
Christopher Creutzig le 18 Oct 2023
pdfinfo returns this information, starting in 23a.

Plus de réponses (2)

Richard Quist
Richard Quist le 30 Avr 2022
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 le 9 Jan 2024
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

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by