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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 sAppStream.GetSize(), FALSE, FALSE); | 531 sAppStream.GetSize(), FALSE, FALSE); |
532 | 532 |
533 CPDF_Dictionary* pStreamDict = pNormalStream->GetDict(); | 533 CPDF_Dictionary* pStreamDict = pNormalStream->GetDict(); |
534 pStreamDict->SetAtInteger("FormType", 1); | 534 pStreamDict->SetAtInteger("FormType", 1); |
535 pStreamDict->SetAtString("Subtype", "Form"); | 535 pStreamDict->SetAtString("Subtype", "Form"); |
536 pStreamDict->SetAtMatrix("Matrix", CFX_Matrix()); | 536 pStreamDict->SetAtMatrix("Matrix", CFX_Matrix()); |
537 pStreamDict->SetAtRect("BBox", rect); | 537 pStreamDict->SetAtRect("BBox", rect); |
538 | 538 |
539 CPDF_Dictionary* pGSDict = new CPDF_Dictionary; | 539 CPDF_Dictionary* pGSDict = new CPDF_Dictionary; |
540 pGSDict->SetAtString("Type", "ExtGState"); | 540 pGSDict->SetAtString("Type", "ExtGState"); |
541 pGSDict->SetAtNumber("ca", 1); | 541 |
542 pGSDict->SetAtNumber("CA", 1); | 542 FX_FLOAT fOpacity = |
| 543 pAnnotDict->KeyExist("CA") ? pAnnotDict->GetNumberBy("CA") : 1; |
| 544 pGSDict->SetAtNumber("ca", fOpacity); |
| 545 pGSDict->SetAtNumber("CA", fOpacity); |
543 pGSDict->SetAtBoolean("AIS", false); | 546 pGSDict->SetAtBoolean("AIS", false); |
544 pGSDict->SetAtString("BM", "Multiply"); | 547 pGSDict->SetAtString("BM", "Multiply"); |
545 | 548 |
546 CPDF_Dictionary* pExtGStateDict = new CPDF_Dictionary; | 549 CPDF_Dictionary* pExtGStateDict = new CPDF_Dictionary; |
547 pExtGStateDict->SetAt("GS", pGSDict); | 550 pExtGStateDict->SetAt("GS", pGSDict); |
548 | 551 |
549 CPDF_Dictionary* pResourceDict = new CPDF_Dictionary; | 552 CPDF_Dictionary* pResourceDict = new CPDF_Dictionary; |
550 pResourceDict->SetAt("ExtGState", pExtGStateDict); | 553 pResourceDict->SetAt("ExtGState", pExtGStateDict); |
551 | 554 |
552 pStreamDict->SetAt("Resources", pResourceDict); | 555 pStreamDict->SetAt("Resources", pResourceDict); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 int32_t nFontIndex, | 814 int32_t nFontIndex, |
812 FX_FLOAT fFontSize) { | 815 FX_FLOAT fFontSize) { |
813 CFX_ByteTextBuf sRet; | 816 CFX_ByteTextBuf sRet; |
814 if (pFontMap) { | 817 if (pFontMap) { |
815 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 818 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
816 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 819 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
817 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 820 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
818 } | 821 } |
819 return sRet.MakeString(); | 822 return sRet.MakeString(); |
820 } | 823 } |
OLD | NEW |