OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include "pdf/pdfium/pdfium_engine.h" | 5 #include "pdf/pdfium/pdfium_engine.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 IFSDK_PAUSE::version = 1; | 654 IFSDK_PAUSE::version = 1; |
655 IFSDK_PAUSE::user = NULL; | 655 IFSDK_PAUSE::user = NULL; |
656 IFSDK_PAUSE::NeedToPauseNow = Pause_NeedToPauseNow; | 656 IFSDK_PAUSE::NeedToPauseNow = Pause_NeedToPauseNow; |
657 } | 657 } |
658 | 658 |
659 PDFiumEngine::~PDFiumEngine() { | 659 PDFiumEngine::~PDFiumEngine() { |
660 for (size_t i = 0; i < pages_.size(); ++i) | 660 for (size_t i = 0; i < pages_.size(); ++i) |
661 pages_[i]->Unload(); | 661 pages_[i]->Unload(); |
662 | 662 |
663 if (doc_) { | 663 if (doc_) { |
664 if (form_) { | 664 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); |
665 FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC); | |
666 } | |
667 FPDF_CloseDocument(doc_); | 665 FPDF_CloseDocument(doc_); |
668 if (form_) { | 666 FPDFDOC_ExitFormFillEnvironment(form_); |
Tom Sepez
2015/05/15 15:06:31
Curious about the ordering here, in that the same
Lei Zhang
2015/05/15 21:23:09
It used to be the other way around, but changed he
| |
669 FPDFDOC_ExitFormFillEnvironment(form_); | |
670 } | |
671 } | 667 } |
672 | 668 FPDFAvail_Destroy(fpdf_availability_); |
673 if (fpdf_availability_) | |
674 FPDFAvail_Destroy(fpdf_availability_); | |
675 | 669 |
676 STLDeleteElements(&pages_); | 670 STLDeleteElements(&pages_); |
677 } | 671 } |
678 | 672 |
679 #ifdef PDF_USE_XFA | 673 #ifdef PDF_USE_XFA |
680 | 674 |
681 // This is just for testing, needs to be removed later | 675 // This is just for testing, needs to be removed later |
682 #if defined(WIN32) | 676 #if defined(WIN32) |
683 #define XFA_TESTFILE(filename) "E:/"#filename | 677 #define XFA_TESTFILE(filename) "E:/"#filename |
684 #else | 678 #else |
(...skipping 3326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4011 double* height) { | 4005 double* height) { |
4012 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); | 4006 FPDF_DOCUMENT doc = FPDF_LoadMemDocument(pdf_buffer, pdf_buffer_size, NULL); |
4013 if (!doc) | 4007 if (!doc) |
4014 return false; | 4008 return false; |
4015 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; | 4009 bool success = FPDF_GetPageSizeByIndex(doc, page_number, width, height) != 0; |
4016 FPDF_CloseDocument(doc); | 4010 FPDF_CloseDocument(doc); |
4017 return success; | 4011 return success; |
4018 } | 4012 } |
4019 | 4013 |
4020 } // namespace chrome_pdf | 4014 } // namespace chrome_pdf |
OLD | NEW |