{
destCatalog.setPageMode( srcPageMode );
}
COSName pageLabels = COSName.getPDFName( "PageLabels" );
COSDictionary destLabels = (COSDictionary)destCatalog.getCOSDictionary().getDictionaryObject( pageLabels );
COSDictionary srcLabels = (COSDictionary)srcCatalog.getCOSDictionary().getDictionaryObject( pageLabels );
if( srcLabels != null )
{
int destPageCount = destination.getNumberOfPages();
COSArray destNums = null;
if( destLabels == null )
{
destLabels = new COSDictionary();
destNums = new COSArray();
destLabels.setItem( COSName.getPDFName( "Nums" ), destNums );
destCatalog.getCOSDictionary().setItem( pageLabels, destLabels );
}
else
{
destNums = (COSArray)destLabels.getDictionaryObject( COSName.getPDFName( "Nums" ) );
}
COSArray srcNums = (COSArray)srcLabels.getDictionaryObject( COSName.getPDFName( "Nums" ) );
for( int i=0; i<srcNums.size(); i+=2 )
{
COSNumber labelIndex = (COSNumber)srcNums.getObject( i );
long labelIndexValue = labelIndex.intValue();
destNums.add( new COSInteger( labelIndexValue + destPageCount ) );