| 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" |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 pStreamResList = pStreamDict->GetDictBy("Resources"); | 444 pStreamResList = pStreamDict->GetDictBy("Resources"); |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 return TRUE; | 448 return TRUE; |
| 449 } | 449 } |
| 450 | 450 |
| 451 } // namespace | 451 } // namespace |
| 452 | 452 |
| 453 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { | 453 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { |
| 454 if (!pAnnotDict || pAnnotDict->GetConstStringBy("Subtype") != "Widget") { | 454 if (!pAnnotDict || pAnnotDict->GetStringBy("Subtype") != "Widget") { |
| 455 return FALSE; | 455 return FALSE; |
| 456 } | 456 } |
| 457 CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); | 457 CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); |
| 458 uint32_t flags = FPDF_GetFieldAttr(pAnnotDict, "Ff") | 458 uint32_t flags = FPDF_GetFieldAttr(pAnnotDict, "Ff") |
| 459 ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() | 459 ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() |
| 460 : 0; | 460 : 0; |
| 461 if (field_type == "Tx") { | 461 if (field_type == "Tx") { |
| 462 return CPVT_GenerateAP::GenerateTextFieldAP(pDoc, pAnnotDict); | 462 return CPVT_GenerateAP::GenerateTextFieldAP(pDoc, pAnnotDict); |
| 463 } | 463 } |
| 464 if (field_type == "Ch") { | 464 if (field_type == "Ch") { |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 int32_t nFontIndex, | 762 int32_t nFontIndex, |
| 763 FX_FLOAT fFontSize) { | 763 FX_FLOAT fFontSize) { |
| 764 CFX_ByteTextBuf sRet; | 764 CFX_ByteTextBuf sRet; |
| 765 if (pFontMap) { | 765 if (pFontMap) { |
| 766 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 766 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
| 767 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 767 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
| 768 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 768 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
| 769 } | 769 } |
| 770 return sRet.GetByteString(); | 770 return sRet.GetByteString(); |
| 771 } | 771 } |
| OLD | NEW |