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 "public/fpdf_flatten.h" | 7 #include "public/fpdf_flatten.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 } | 475 } |
476 | 476 |
477 CPDF_Dictionary* pXObject = pNewXORes->GetDictBy("XObject"); | 477 CPDF_Dictionary* pXObject = pNewXORes->GetDictBy("XObject"); |
478 if (!pXObject) { | 478 if (!pXObject) { |
479 pXObject = new CPDF_Dictionary; | 479 pXObject = new CPDF_Dictionary; |
480 pNewXORes->SetAt("XObject", pXObject); | 480 pNewXORes->SetAt("XObject", pXObject); |
481 } | 481 } |
482 | 482 |
483 CFX_ByteString sFormName; | 483 CFX_ByteString sFormName; |
484 sFormName.Format("F%d", i); | 484 sFormName.Format("F%d", i); |
485 uint32_t dwObjNum = pDocument->AddIndirectObject(pObj); | 485 uint32_t dwStreamObjNum = pDocument->AddIndirectObject(pObj); |
486 pXObject->SetAtReference(sFormName, pDocument, dwObjNum); | 486 pXObject->SetAtReference(sFormName, pDocument, dwStreamObjNum); |
487 | 487 |
488 CPDF_StreamAcc acc; | 488 CPDF_StreamAcc acc; |
489 acc.LoadAllData(pNewXObject); | 489 acc.LoadAllData(pNewXObject); |
490 | 490 |
491 const uint8_t* pData = acc.GetData(); | 491 const uint8_t* pData = acc.GetData(); |
492 CFX_ByteString sStream(pData, acc.GetSize()); | 492 CFX_ByteString sStream(pData, acc.GetSize()); |
493 CFX_ByteString sTemp; | 493 CFX_ByteString sTemp; |
494 | 494 |
495 if (matrix.IsIdentity()) { | 495 if (matrix.IsIdentity()) { |
496 matrix.a = 1.0f; | 496 matrix.a = 1.0f; |
(...skipping 10 matching lines...) Expand all Loading... |
507 sStream += sTemp; | 507 sStream += sTemp; |
508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); | 508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); |
509 } | 509 } |
510 pPageDict->RemoveAt("Annots"); | 510 pPageDict->RemoveAt("Annots"); |
511 | 511 |
512 ObjectArray.RemoveAll(); | 512 ObjectArray.RemoveAll(); |
513 RectArray.RemoveAll(); | 513 RectArray.RemoveAll(); |
514 | 514 |
515 return FLATTEN_SUCCESS; | 515 return FLATTEN_SUCCESS; |
516 } | 516 } |
OLD | NEW |