00001 #include <sstream>
00002
00003 #include "NOPackage.h"
00004 #include "NOPage.h"
00005
00006 using namespace NiXPSObjects;
00007
00008 void extractImage()
00009 {
00010 NOPackage *baseDoc = NOPackage::readPackageFromFile("CoreProperty2.xps");
00011
00012
00013 NOPage basePage = baseDoc->getDocument(1).getPage(1);
00014
00015 NOImageVector lImages(*baseDoc);
00016 UInt32 numberOfImages = basePage.getImages(lImages);
00017
00018
00019 int i = 0;
00020 for (; i < numberOfImages; i++)
00021 {
00022 std::stringstream so;
00023 so << "imagefile " << i;
00024 NOImage lImage = lImages[i];
00025 lImage.writeImageToFile(so.str());
00026 }
00027 }