FX_BOOL CPDF_Annot::DrawAppearance(CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_Matrix* pUser2Device, AppearanceMode mode, const CPDF_RenderOptions* pOptions) { if (IsAnnotationHidden(m_pAnnotDict)) return FALSE; if (m_nSubtype == CPDF_Annot::Subtype::POPUP && !m_bOpenState) return FALSE; // It might happen that by the time this annotation instance was created, // it was flagged as "hidden" (e.g. /F 2), and hence CPVT_GenerateAP decided // to not "generate" its AP. // If for a reason the object is no longer hidden, but still does not have // its "AP" generated, generate it now. GenerateAPIfNeeded(); CFX_Matrix matrix; CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); if (!pForm) { return FALSE; } CPDF_RenderContext context(pPage); context.AppendLayer(pForm, &matrix); context.Render(pDevice, pOptions, nullptr); return TRUE; }
FX_BOOL CPDF_Annot::DrawInContext(const CPDF_Page* pPage, const CPDF_RenderContext* pContext, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode) { CFX_Matrix matrix; CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); if (!pForm) { return FALSE; } ((CPDF_RenderContext*)pContext)->AppendObjectList(pForm, &matrix); return TRUE; }
FX_BOOL CPDF_Annot::DrawAppearance(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, const CFX_AffineMatrix* pUser2Device, AppearanceMode mode, const CPDF_RenderOptions* pOptions) { CFX_Matrix matrix; CPDF_Form* pForm = FPDFDOC_Annot_GetMatrix(pPage, this, mode, pUser2Device, matrix); if (!pForm) { return FALSE; } CPDF_RenderContext context; context.Create((CPDF_Page*)pPage); context.DrawObjectList(pDevice, pForm, &matrix, pOptions); return TRUE; }