| 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_doc.h" | 7 #include "../../include/fpdfdoc/fpdf_doc.h" |
| 8 #include "../../include/fpdfdoc/fpdf_vt.h" | 8 #include "../../include/fpdfdoc/fpdf_vt.h" |
| 9 #include "pdf_vt.h" | 9 #include "pdf_vt.h" |
| 10 #include "../../include/fpdfdoc/fpdf_ap.h" | 10 #include "../../include/fpdfdoc/fpdf_ap.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1"); | 299 pFontDict->SetAtName(FX_BSTRC("Subtype"), "Type1"); |
| 300 pFontDict->SetAtName(FX_BSTRC("BaseFont"), "Helvetica"); | 300 pFontDict->SetAtName(FX_BSTRC("BaseFont"), "Helvetica"); |
| 301 pFontDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding"); | 301 pFontDict->SetAtName(FX_BSTRC("Encoding"), "WinAnsiEncoding"); |
| 302 pDoc->AddIndirectObject(pFontDict); | 302 pDoc->AddIndirectObject(pFontDict); |
| 303 pDRFontDict->SetAtReference(sFontName.Mid(1), pDoc, pFontDict); | 303 pDRFontDict->SetAtReference(sFontName.Mid(1), pDoc, pFontDict); |
| 304 } | 304 } |
| 305 CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); | 305 CPDF_Font* pDefFont = pDoc->LoadFont(pFontDict); |
| 306 if (!pDefFont) { | 306 if (!pDefFont) { |
| 307 return FALSE; | 307 return FALSE; |
| 308 } | 308 } |
| 309 CFX_CharMap* pCharMap = pDefFont->GetCharMap(); | |
| 310 CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect"); | 309 CPDF_Rect rcAnnot = pAnnotDict->GetRect("Rect"); |
| 311 FX_INT32 nRotate = 0; | 310 FX_INT32 nRotate = 0; |
| 312 if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) { | 311 if (CPDF_Dictionary * pMKDict = pAnnotDict->GetDict("MK")) { |
| 313 nRotate = pMKDict->GetInteger("R"); | 312 nRotate = pMKDict->GetInteger("R"); |
| 314 } | 313 } |
| 315 CPDF_Rect rcBBox; | 314 CPDF_Rect rcBBox; |
| 316 CPDF_Matrix matrix; | 315 CPDF_Matrix matrix; |
| 317 switch (nRotate % 360) { | 316 switch (nRotate % 360) { |
| 318 case 0: | 317 case 0: |
| 319 rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top -
rcAnnot.bottom); | 318 rcBBox = CPDF_Rect(0, 0, rcAnnot.right - rcAnnot.left, rcAnnot.top -
rcAnnot.bottom); |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 case CT_GRAY: | 798 case CT_GRAY: |
| 800 sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G")
<< "\n"; | 799 sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G")
<< "\n"; |
| 801 break; | 800 break; |
| 802 case CT_CMYK: | 801 case CT_CMYK: |
| 803 sColorStream << color.fColor1 << " " << color.fColor2 << " " << colo
r.fColor3 << " " << color.fColor4 << " " | 802 sColorStream << color.fColor1 << " " << color.fColor2 << " " << colo
r.fColor3 << " " << color.fColor4 << " " |
| 804 << (bFillOrStroke ? "k" : "K") << "\n"; | 803 << (bFillOrStroke ? "k" : "K") << "\n"; |
| 805 break; | 804 break; |
| 806 } | 805 } |
| 807 return sColorStream.GetByteString(); | 806 return sColorStream.GetByteString(); |
| 808 } | 807 } |
| OLD | NEW |