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/fpdfdoc/cpvt_color.h" | 14 #include "core/fpdfdoc/cpvt_color.h" |
15 #include "core/fpdfdoc/cpvt_fontmap.h" | 15 #include "core/fpdfdoc/cpvt_fontmap.h" |
| 16 #include "core/fpdfdoc/doc_vt.h" |
16 #include "core/fpdfdoc/include/cpvt_word.h" | 17 #include "core/fpdfdoc/include/cpvt_word.h" |
17 #include "core/fpdfdoc/include/fpdf_doc.h" | 18 #include "core/fpdfdoc/include/fpdf_doc.h" |
18 #include "core/fpdfdoc/pdf_vt.h" | |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, | 22 FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, |
23 CPDF_Dictionary* pAnnotDict, | 23 CPDF_Dictionary* pAnnotDict, |
24 const int32_t& nWidgetType) { | 24 const int32_t& nWidgetType) { |
25 CPDF_Dictionary* pFormDict = nullptr; | 25 CPDF_Dictionary* pFormDict = nullptr; |
26 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) | 26 if (CPDF_Dictionary* pRootDict = pDoc->GetRoot()) |
27 pFormDict = pRootDict->GetDictBy("AcroForm"); | 27 pFormDict = pRootDict->GetDictBy("AcroForm"); |
28 if (!pFormDict) | 28 if (!pFormDict) |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 int32_t nFontIndex, | 761 int32_t nFontIndex, |
762 FX_FLOAT fFontSize) { | 762 FX_FLOAT fFontSize) { |
763 CFX_ByteTextBuf sRet; | 763 CFX_ByteTextBuf sRet; |
764 if (pFontMap) { | 764 if (pFontMap) { |
765 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 765 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
766 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 766 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
767 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 767 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
768 } | 768 } |
769 return sRet.AsStringC(); | 769 return sRet.AsStringC(); |
770 } | 770 } |
OLD | NEW |