| 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/fpdfppo.h" | 7 #include "../include/fpdfppo.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 if(!pNewRoot) return FALSE; | 43 if(!pNewRoot) return FALSE; |
| 44 | 44 |
| 45 //Set the document information//////////////////////////////////////////
// | 45 //Set the document information//////////////////////////////////////////
// |
| 46 | 46 |
| 47 CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo(); | 47 CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo(); |
| 48 | 48 |
| 49 if(!DInfoDict) | 49 if(!DInfoDict) |
| 50 return FALSE; | 50 return FALSE; |
| 51 | 51 |
| 52 CFX_ByteString producerstr; | 52 CFX_ByteString producerstr; |
| 53 » | 53 » producerstr.Format("PDFium"); |
| 54 #ifdef FOXIT_CHROME_BUILD | |
| 55 » producerstr.Format("Google"); | |
| 56 #else | |
| 57 » producerstr.Format("Foxit PDF SDK %s - Foxit Corporation", "2.0"); | |
| 58 #endif | |
| 59 DInfoDict->SetAt("Producer", new CPDF_String(producerstr)); | 54 DInfoDict->SetAt("Producer", new CPDF_String(producerstr)); |
| 60 | 55 |
| 61 //Set type//////////////////////////////////////////////////////////////
// | 56 //Set type//////////////////////////////////////////////////////////////
// |
| 62 CFX_ByteString cbRootType = pNewRoot->GetString("Type",""); | 57 CFX_ByteString cbRootType = pNewRoot->GetString("Type",""); |
| 63 if( cbRootType.Equal("") ) | 58 if( cbRootType.Equal("") ) |
| 64 { | 59 { |
| 65 pNewRoot->SetAt("Type", new CPDF_Name("Catalog")); | 60 pNewRoot->SetAt("Type", new CPDF_Name("Catalog")); |
| 66 } | 61 } |
| 67 | 62 |
| 68 CPDF_Dictionary* pNewPages = (CPDF_Dictionary*)(pNewRoot->GetElement("Pa
ges")? pNewRoot->GetElement("Pages")->GetDirect() : NULL); | 63 CPDF_Dictionary* pNewPages = (CPDF_Dictionary*)(pNewRoot->GetElement("Pa
ges")? pNewRoot->GetElement("Pages")->GetDirect() : NULL); |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 return FALSE; | 463 return FALSE; |
| 469 CPDFXFA_Document* pDstDoc = (CPDFXFA_Document*)dest_doc; | 464 CPDFXFA_Document* pDstDoc = (CPDFXFA_Document*)dest_doc; |
| 470 CPDF_Document* pDstPDFDoc = pDstDoc->GetPDFDoc(); | 465 CPDF_Document* pDstPDFDoc = pDstDoc->GetPDFDoc(); |
| 471 CPDF_Dictionary* pDstDict = pDstPDFDoc->GetRoot(); | 466 CPDF_Dictionary* pDstDict = pDstPDFDoc->GetRoot(); |
| 472 if(!pDstDict) | 467 if(!pDstDict) |
| 473 return FALSE; | 468 return FALSE; |
| 474 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); | 469 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); |
| 475 return TRUE; | 470 return TRUE; |
| 476 } | 471 } |
| 477 | 472 |
| OLD | NEW |