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_dataavail.h" | 7 #include "../../public/fpdf_dataavail.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 | 9 |
10 extern void ProcessParseError(FX_DWORD err_code); | 10 extern void ProcessParseError(FX_DWORD err_code); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, | 90 DLLEXPORT int STDCALL FPDFAvail_IsDocAvail(FPDF_AVAIL avail, |
91 FX_DOWNLOADHINTS* hints) { | 91 FX_DOWNLOADHINTS* hints) { |
92 if (avail == NULL || hints == NULL) | 92 if (avail == NULL || hints == NULL) |
93 return 0; | 93 return 0; |
94 CFPDF_DownloadHintsWrap hints_wrap(hints); | 94 CFPDF_DownloadHintsWrap hints_wrap(hints); |
95 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap); | 95 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsDocAvail(&hints_wrap); |
96 } | 96 } |
97 | 97 |
98 extern void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code); | |
99 | |
100 DLLEXPORT FPDF_DOCUMENT STDCALL | 98 DLLEXPORT FPDF_DOCUMENT STDCALL |
101 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { | 99 FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { |
102 if (avail == NULL) | 100 if (avail == NULL) |
103 return NULL; | 101 return NULL; |
104 CPDF_Parser* pParser = new CPDF_Parser; | 102 CPDF_Parser* pParser = new CPDF_Parser; |
105 pParser->SetPassword(password); | 103 pParser->SetPassword(password); |
106 | 104 |
107 FX_DWORD err_code = pParser->StartAsynParse( | 105 FX_DWORD err_code = pParser->StartAsynParse( |
108 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); | 106 ((CFPDF_DataAvail*)avail)->m_pDataAvail->GetFileRead()); |
109 if (err_code) { | 107 if (err_code) { |
(...skipping 29 matching lines...) Expand all Loading... |
139 return -1; | 137 return -1; |
140 CFPDF_DownloadHintsWrap hints_wrap(hints); | 138 CFPDF_DownloadHintsWrap hints_wrap(hints); |
141 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); | 139 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); |
142 } | 140 } |
143 | 141 |
144 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { | 142 DLLEXPORT FPDF_BOOL STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { |
145 if (avail == NULL) | 143 if (avail == NULL) |
146 return -1; | 144 return -1; |
147 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); | 145 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); |
148 } | 146 } |
OLD | NEW |