PDF Multi Page information

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
JMNahon
Posts: 2
Joined: 2017-05-21T06:56:37-07:00
Authentication code: 1151

PDF Multi Page information

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF Multi Page information

Post 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?
snibgo's IM pages: im.snibgo.com
JMNahon
Posts: 2
Joined: 2017-05-21T06:56:37-07:00
Authentication code: 1151

Re: PDF Multi Page information

Post 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 ?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF Multi Page information

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply