Пример #1
0
bool CPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) const {
  for (size_t i = 0; i < pObj->m_ContentMarks.CountItems(); ++i) {
    const CPDF_ContentMarkItem* item = pObj->m_ContentMarks.GetItem(i);
    if (item->GetName() == "OC" &&
        item->GetParamType() == CPDF_ContentMarkItem::kPropertiesDict &&
        !CheckOCGVisible(item->GetParam())) {
      return false;
    }
  }
  return true;
}
Пример #2
0
FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) {
  const CPDF_ContentMarkData* pData = pObj->m_ContentMark;
  int nItems = pData->CountItems();
  for (int i = 0; i < nItems; i++) {
    CPDF_ContentMarkItem& item = pData->GetItem(i);
    if (item.GetName() == FX_BSTRC("OC") &&
        item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
      CPDF_Dictionary* pOCG =
          ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
      if (!CheckOCGVisible(pOCG)) {
        return FALSE;
      }
    }
  }
  return TRUE;
}