docexample_extractimage.cpp

00001 #include <sstream>
00002 
00003 #include "NOPackage.h"
00004 #include "NOPage.h"
00005 
00006 using namespace NiXPSObjects;
00007 
00008 void extractImage(const UTF8Char *pXPSIn, const UTF8Char *pImageOut)
00009 {
00010         NOPackage *baseDoc = NOPackage::readPackageFromFile(pXPSIn);
00011         
00012         // get the 1st document, the second paged (0-based index!)
00013         NOPage basePage = baseDoc->getDocument(0).getPage(1);
00014 
00015         NOImageVector lImages(*baseDoc);
00016         /*UInt32 numberOfImages = */basePage.getImages(lImages);
00017 
00018         // write out the 2nd image to a file
00019         NOImage lImage = lImages[1];
00020         lImage.writeImageToFile(pImageOut);
00021 
00022         NOPackage::destroyPackage(baseDoc);
00023 }

Generated on Thu Jul 3 15:30:32 2008 for NiXPS Library SDK by  doxygen 1.5.3