docexample_replacefont.cpp

00001 #include "NOPackage.h"
00002 #include "NOFontVector.h"
00003 #include "NOPage.h"
00004 
00005 using namespace NiXPSObjects;
00006 
00007 void replaceFont(const UTF8Char *pXPSIn, const UTF8Char *pFontIn, const UTF8Char *pXPSOut)
00008 {
00009         NOPackage *lPackage=NOPackage::readPackageFromFile(pXPSIn);
00010         
00011         NOFontVector lFonts(*lPackage);
00012         lPackage->getDocument(0).getPage(0).getFonts(lFonts);
00013                 
00014         if (!lFonts[0].replaceWithFile(pFontIn))
00015         {
00016                 // error handling here
00017         }
00018 
00019         // write the modified package out
00020         lPackage->writePackageToFile(pXPSOut);
00021 
00022         NOPackage::destroyPackage(lPackage);
00023 }

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