Page 1 of 1

PDF Multi Page information

Posted: 2017-05-21T14:08:53+00:00
by JMNahon
hi,

I got pdf files, with multi page.
I develop a .bat file with this line

@for /R %%a in (*.jpg *.tif *.PDF) do magick identify -ping -format "%%d\\%%f;%%n;%%p; %%[fx:(w/resolution.x)*2.54];%%[fx:(h/resolution.y)*2.54];%%w;%%h;%%[depth];%%x\n" "%%a" >> %2

Whene this line execute a pdf file for x pages, the system write on %2 files
H:\comptage\volume\200PDF-20000images\0001\0001.pdf;100;0; 118.886;84.1022;3370;2384;16;72
H:\comptage\volume\200PDF-20000images\0001\0001.pdf;100;1; 42.4392;29.6686;1203;841;16;72
H:\comptage\volume\200PDF-20000images\0001\0001.pdf;100;2; 20.9903;29.5981;595;839;16;72

In this case 0001.pdf have 3 pages

I try to do the same thing in vbscript files

Result = imageMagick.convert(objFile.name,"-ping","-format","%d%f;%n; %p; %[fx:(w/resolution.x)*2.54]; %[fx:(h/resolution.y)*2.54]; %w;%h; %[depth]; %x\n","info:")

But in this case, the system return only information of first page

Do you have an idea ?

jean-marc

Re: PDF Multi Page information

Posted: 2017-05-21T15:34:19+00:00
by snibgo
As this is a question about using IM with Visual Basic, I'll move it to that forum.

I don't use VB, but I suppose "Result" is (or should be) an array of three elements. What makes you think it isn't?

Re: PDF Multi Page information

Posted: 2017-05-21T16:28:10+00:00
by JMNahon
Your remark is excelent, result is variant (not type in vbscript). I try to change to array, but I have a error in exécution
Finaly, I don't understrand why .bat solution, give a good result ;-)
Do you have An idea to array ?

Re: PDF Multi Page information

Posted: 2017-05-21T16:59:06+00:00
by snibgo
In BAT, your command writes results to stdout, which you redirect to a file.

I assume you can do the same thing in VB, by changing your last element from "info:" to "info:myfile.txt".

If you want the result in an array "Result", I don't know how to do that.