*/
    protected void readOCProperties() {
    	if (!documentOCG.isEmpty()) {
    		return;
    	}
    	PdfDictionary dict = reader.getCatalog().getAsDict(PdfName.OCPROPERTIES);
    	if (dict == null) {
    		return;
    	}
    	PdfArray ocgs = dict.getAsArray(PdfName.OCGS);
    	PdfIndirectReference ref;
    	PdfLayer layer;
    	HashMap<String, PdfLayer> ocgmap = new HashMap<String, PdfLayer>();
    	for (Iterator<PdfObject> i = ocgs.listIterator(); i.hasNext(); ) {
    		ref = (PdfIndirectReference)i.next();
    		layer = new PdfLayer(null);
    		layer.setRef(ref);
    		layer.setOnPanel(false);
			layer.merge((PdfDictionary)PdfReader.getPdfObject(ref));
    		ocgmap.put(ref.toString(), layer);
    	}
    	PdfDictionary d = dict.getAsDict(PdfName.D);
    	PdfArray off = d.getAsArray(PdfName.OFF);
    	if (off != null) {
    		for (Iterator<PdfObject> i = off.listIterator(); i.hasNext(); ) {
    			ref = (PdfIndirectReference)i.next();
    			layer = ocgmap.get(ref.toString());
    			layer.setOn(false);
    		}
    	}
    	PdfArray order = d.getAsArray(PdfName.ORDER);
    	if (order != null) {
    		addOrder(null, order, ocgmap);
    	}
    	documentOCG.addAll(ocgmap.values());
    	OCGRadioGroup = d.getAsArray(PdfName.RBGROUPS);
    	if (OCGRadioGroup == null)
    		OCGRadioGroup = new PdfArray();
    	OCGLocked = d.getAsArray(PdfName.LOCKED);
    	if (OCGLocked == null)
    		OCGLocked = new PdfArray();
    }