PDF problems

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
spider

PDF problems

Post by spider »

Hi!
I need some help. In code c++ i need to ask number of pages in pdf-file, something like : system("identify -format %n some.pdf"); but without use 'system' if this possible? And how?
Thank you.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: PDF problems

Post by magick »

Try this:
  • list<Image> imageList;
    readImages( &imageList, srcdir + "smile_anim.miff" );
    cout << "Total pages: " << imageList.size() << endl;
The the ping() method instead of readImages() if you only want the number of pages.
spider

Re: PDF problems

Post by spider »

Thank you!
It work, but unfortunately it work too slow... if you show me some sample code with using ping(), or something else? Please...
I need number of pages only....
Post Reply