| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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 "../../include/fpdfdoc/fpdf_ap.h" |
| 7 #include "../../include/fpdfdoc/fpdf_doc.h" | 8 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 #include "../../include/fpdfdoc/fpdf_vt.h" | 9 #include "../../include/fpdfdoc/fpdf_vt.h" |
| 10 #include "doc_utils.h" |
| 9 #include "pdf_vt.h" | 11 #include "pdf_vt.h" |
| 10 #include "../../include/fpdfdoc/fpdf_ap.h" | 12 |
| 11 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { | 13 FX_BOOL FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { |
| 12 if (!pAnnotDict || | 14 if (!pAnnotDict || |
| 13 pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) { | 15 pAnnotDict->GetConstString("Subtype") != FX_BSTRC("Widget")) { |
| 14 return FALSE; | 16 return FALSE; |
| 15 } | 17 } |
| 16 CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); | 18 CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString(); |
| 17 FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff") | 19 FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff") |
| 18 ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() | 20 ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger() |
| 19 : 0; | 21 : 0; |
| 20 if (field_type == "Tx") { | 22 if (field_type == "Tx") { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 CPDF_Dictionary* pResDict, | 71 CPDF_Dictionary* pResDict, |
| 70 CPDF_Font* pDefFont, | 72 CPDF_Font* pDefFont, |
| 71 const CFX_ByteString& sDefFontAlias) | 73 const CFX_ByteString& sDefFontAlias) |
| 72 : m_pDocument(pDoc), | 74 : m_pDocument(pDoc), |
| 73 m_pResDict(pResDict), | 75 m_pResDict(pResDict), |
| 74 m_pDefFont(pDefFont), | 76 m_pDefFont(pDefFont), |
| 75 m_sDefFontAlias(sDefFontAlias), | 77 m_sDefFontAlias(sDefFontAlias), |
| 76 m_pSysFont(NULL), | 78 m_pSysFont(NULL), |
| 77 m_sSysFontAlias() {} | 79 m_sSysFontAlias() {} |
| 78 CPVT_FontMap::~CPVT_FontMap() {} | 80 CPVT_FontMap::~CPVT_FontMap() {} |
| 79 extern CPDF_Font* AddNativeInterFormFont(CPDF_Dictionary*& pFormDict, | |
| 80 CPDF_Document* pDocument, | |
| 81 CFX_ByteString& csNameTag); | |
| 82 void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, | 81 void CPVT_FontMap::GetAnnotSysPDFFont(CPDF_Document* pDoc, |
| 83 CPDF_Dictionary* pResDict, | 82 CPDF_Dictionary* pResDict, |
| 84 CPDF_Font*& pSysFont, | 83 CPDF_Font*& pSysFont, |
| 85 CFX_ByteString& sSysFontAlias) { | 84 CFX_ByteString& sSysFontAlias) { |
| 86 if (pDoc && pResDict) { | 85 if (pDoc && pResDict) { |
| 87 CFX_ByteString sFontAlias; | 86 CFX_ByteString sFontAlias; |
| 88 CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDict("AcroForm"); | 87 CPDF_Dictionary* pFormDict = pDoc->GetRoot()->GetDict("AcroForm"); |
| 89 if (CPDF_Font* pPDFFont = | 88 if (CPDF_Font* pPDFFont = |
| 90 AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias)) { | 89 AddNativeInterFormFont(pFormDict, pDoc, sSysFontAlias)) { |
| 91 if (CPDF_Dictionary* pFontList = pResDict->GetDict("Font")) { | 90 if (CPDF_Dictionary* pFontList = pResDict->GetDict("Font")) { |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 << "\n"; | 930 << "\n"; |
| 932 break; | 931 break; |
| 933 case CT_CMYK: | 932 case CT_CMYK: |
| 934 sColorStream << color.fColor1 << " " << color.fColor2 << " " | 933 sColorStream << color.fColor1 << " " << color.fColor2 << " " |
| 935 << color.fColor3 << " " << color.fColor4 << " " | 934 << color.fColor3 << " " << color.fColor4 << " " |
| 936 << (bFillOrStroke ? "k" : "K") << "\n"; | 935 << (bFillOrStroke ? "k" : "K") << "\n"; |
| 937 break; | 936 break; |
| 938 } | 937 } |
| 939 return sColorStream.GetByteString(); | 938 return sColorStream.GetByteString(); |
| 940 } | 939 } |
| OLD | NEW |