You are not logged in.
Pages: 1
Bonjour,
Je cherche à insérer le nombre de pages des fichier PDF
Est-ce possible?
Merci
I want to insert the number of pages of PDF files
Is it possible?
Thank you
Offline
Yes, it is possible with the use of Pascal Script rule in combination with Xpdf command line tools.
Download Xpdf command line tools and extract "pdfinfo.exe" into ReNamer's folder.
Then, add the following Pascal Script rule:
{ Extract PDF page count using Xpdf }
const
EXE = 'pdfinfo.exe -enc UTF-8';
TAG = '[\r\n]Pages\s*\:\s*(.*?)[\r\n]';
var
Command, Output: String;
Matches: TWideStringArray;
begin
Command := EXE+' "'+FilePath+'"';
if ExecConsoleApp(Command, Output) = 0 then
begin
Matches := SubMatchesRegEx(Output, TAG, False);
if Length(Matches) > 0 then
FileName := WideExtractBaseName(FileName) +
' [' + Matches[0] + ']' +
WideExtractFileExt(FileName);
end;
end.
This script appends the page count to the end of the filename.
The script is based on this:
https://www.den4b.com/wiki/ReNamer:Scripts:Xpdf
Offline
Pages: 1