Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_annotcontext.cpp
Go to the documentation of this file.
1// Copyright 2018 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "core/fpdfapi/page/cpdf_annotcontext.h"
8
9#include <utility>
10
11#include "core/fpdfapi/page/cpdf_form.h"
12#include "core/fpdfapi/page/cpdf_page.h"
13#include "core/fpdfapi/parser/cpdf_dictionary.h"
14#include "core/fpdfapi/parser/cpdf_stream.h"
15#include "third_party/base/check.h"
16
17#ifdef SetForm
18#undef SetForm
19#endif
20
21CPDF_AnnotContext::CPDF_AnnotContext(RetainPtr<CPDF_Dictionary> pAnnotDict,
22 IPDF_Page* pPage)
24 DCHECK(m_pAnnotDict);
25 DCHECK(m_pPage);
26 DCHECK(m_pPage->AsPDFPage());
27}
28
30
31void CPDF_AnnotContext::SetForm(RetainPtr<CPDF_Stream> pStream) {
32 if (!pStream)
33 return;
34
35 // Reset the annotation matrix to be the identity matrix, since the
36 // appearance stream already takes matrix into account.
37 pStream->GetMutableDict()->SetMatrixFor("Matrix", CFX_Matrix());
38
39 m_pAnnotForm = std::make_unique<CPDF_Form>(
40 m_pPage->GetDocument(), m_pPage->AsPDFPage()->GetMutableResources(),
41 pStream);
42 m_pAnnotForm->ParseContent();
43}
CFX_Matrix()=default
void SetForm(RetainPtr< CPDF_Stream > pStream)
CPDF_AnnotContext(RetainPtr< CPDF_Dictionary > pAnnotDict, IPDF_Page *pPage)