OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fpdfdoc/cpvt_generateap.h" | 7 #include "core/fpdfdoc/cpvt_generateap.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" |
| 14 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h" |
14 #include "core/fpdfdoc/cpvt_color.h" | 15 #include "core/fpdfdoc/cpvt_color.h" |
15 #include "core/fpdfdoc/cpvt_fontmap.h" | 16 #include "core/fpdfdoc/cpvt_fontmap.h" |
| 17 #include "core/fpdfdoc/include/cpdf_formfield.h" |
16 #include "core/fpdfdoc/include/cpvt_word.h" | 18 #include "core/fpdfdoc/include/cpvt_word.h" |
17 #include "core/fpdfdoc/include/fpdf_doc.h" | |
18 #include "core/fpdfdoc/pdf_vt.h" | 19 #include "core/fpdfdoc/pdf_vt.h" |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, | 23 FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, |
23 CPDF_Dictionary* pAnnotDict, | 24 CPDF_Dictionary* pAnnotDict, |
24 const int32_t& nWidgetType) { | 25 const int32_t& nWidgetType) { |
25 CPDF_Dictionary* pFormDict = nullptr; | 26 CPDF_Dictionary* pFormDict = nullptr; |
26 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) | 27 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) |
27 pFormDict = pRootDict->GetDictBy("AcroForm"); | 28 pFormDict = pRootDict->GetDictBy("AcroForm"); |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 int32_t nFontIndex, | 751 int32_t nFontIndex, |
751 FX_FLOAT fFontSize) { | 752 FX_FLOAT fFontSize) { |
752 CFX_ByteTextBuf sRet; | 753 CFX_ByteTextBuf sRet; |
753 if (pFontMap) { | 754 if (pFontMap) { |
754 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 755 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
755 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 756 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
756 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 757 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
757 } | 758 } |
758 return sRet.MakeString(); | 759 return sRet.MakeString(); |
759 } | 760 } |
OLD | NEW |