| 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_formfill.h" | 7 #include "public/fpdf_formfill.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 options.m_Flags |= RENDER_CLEARTYPE; | 315 options.m_Flags |= RENDER_CLEARTYPE; |
| 316 else | 316 else |
| 317 options.m_Flags &= ~RENDER_CLEARTYPE; | 317 options.m_Flags &= ~RENDER_CLEARTYPE; |
| 318 // Grayscale output | 318 // Grayscale output |
| 319 if (flags & FPDF_GRAYSCALE) { | 319 if (flags & FPDF_GRAYSCALE) { |
| 320 options.m_ColorMode = RENDER_COLOR_GRAY; | 320 options.m_ColorMode = RENDER_COLOR_GRAY; |
| 321 options.m_ForeColor = 0; | 321 options.m_ForeColor = 0; |
| 322 options.m_BackColor = 0xffffff; | 322 options.m_BackColor = 0xffffff; |
| 323 } | 323 } |
| 324 options.m_AddFlags = flags >> 8; | 324 options.m_AddFlags = flags >> 8; |
| 325 options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument); | 325 options.m_pOCContext = |
| 326 new CPDF_OCContext(pPage->m_pDocument, CPDF_OCContext::View); |
| 326 #else // PDF_ENABLE_XFA | 327 #else // PDF_ENABLE_XFA |
| 327 CPDFXFA_Document* pDocument = pPage->GetDocument(); | 328 CPDFXFA_Document* pDocument = pPage->GetDocument(); |
| 328 if (!pDocument) | 329 if (!pDocument) |
| 329 return; | 330 return; |
| 330 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); | 331 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); |
| 331 if (!pPDFDoc) | 332 if (!pPDFDoc) |
| 332 return; | 333 return; |
| 333 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; | 334 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; |
| 334 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); | 335 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); |
| 335 if (!pFXDoc) | 336 if (!pFXDoc) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 359 else | 360 else |
| 360 options.m_Flags &= ~RENDER_CLEARTYPE; | 361 options.m_Flags &= ~RENDER_CLEARTYPE; |
| 361 | 362 |
| 362 // Grayscale output | 363 // Grayscale output |
| 363 if (flags & FPDF_GRAYSCALE) { | 364 if (flags & FPDF_GRAYSCALE) { |
| 364 options.m_ColorMode = RENDER_COLOR_GRAY; | 365 options.m_ColorMode = RENDER_COLOR_GRAY; |
| 365 options.m_ForeColor = 0; | 366 options.m_ForeColor = 0; |
| 366 options.m_BackColor = 0xffffff; | 367 options.m_BackColor = 0xffffff; |
| 367 } | 368 } |
| 368 options.m_AddFlags = flags >> 8; | 369 options.m_AddFlags = flags >> 8; |
| 369 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); | 370 options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View); |
| 370 | 371 |
| 371 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) | 372 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) |
| 372 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); | 373 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); |
| 373 #endif // PDF_ENABLE_XFA | 374 #endif // PDF_ENABLE_XFA |
| 374 | 375 |
| 375 pDevice->RestoreState(); | 376 pDevice->RestoreState(); |
| 376 delete options.m_pOCContext; | 377 delete options.m_pOCContext; |
| 377 #ifdef PDF_ENABLE_XFA | 378 #ifdef PDF_ENABLE_XFA |
| 378 options.m_pOCContext = NULL; | 379 options.m_pOCContext = NULL; |
| 379 #endif // PDF_ENABLE_XFA | 380 #endif // PDF_ENABLE_XFA |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); | 716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); |
| 716 } | 717 } |
| 717 } else { | 718 } else { |
| 718 if (aa.ActionExist(CPDF_AAction::ClosePage)) { | 719 if (aa.ActionExist(CPDF_AAction::ClosePage)) { |
| 719 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); | 720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); |
| 720 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); | 721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); |
| 721 } | 722 } |
| 722 } | 723 } |
| 723 } | 724 } |
| 724 } | 725 } |
| OLD | NEW |