private void mergePage(COSArray array, PDPage page )
{
int layoutPageNum = pageCount % layoutPages.size();
LayoutPage layoutPage = (LayoutPage) layoutPages.get(layoutPageNum);
PDResources resources = page.findResources();
if( resources == null )
{
resources = new PDResources();
page.setResources( resources );
}
COSDictionary docResDict = resources.getCOSDictionary();
COSDictionary layoutResDict = layoutPage.res;
mergeArray(COSName.PROC_SET, docResDict, layoutResDict);
mergeDictionary(COSName.FONT, docResDict, layoutResDict, layoutPage.objectNameMap);
mergeDictionary(COSName.XOBJECT, docResDict, layoutResDict, layoutPage.objectNameMap);
mergeDictionary(COSName.EXT_G_STATE, docResDict, layoutResDict, layoutPage.objectNameMap);