| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits.h> | 5 #include <limits.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <wchar.h> | 9 #include <wchar.h> |
| 10 | 10 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if (FPDFAvail_IsLinearized(pdf_avail)) { | 383 if (FPDFAvail_IsLinearized(pdf_avail)) { |
| 384 fprintf(stderr, "Linearized path...\n"); | 384 fprintf(stderr, "Linearized path...\n"); |
| 385 doc = FPDFAvail_GetDocument(pdf_avail, nullptr); | 385 doc = FPDFAvail_GetDocument(pdf_avail, nullptr); |
| 386 } else { | 386 } else { |
| 387 fprintf(stderr, "Non-linearized path...\n"); | 387 fprintf(stderr, "Non-linearized path...\n"); |
| 388 doc = FPDF_LoadCustomDocument(&file_access, nullptr); | 388 doc = FPDF_LoadCustomDocument(&file_access, nullptr); |
| 389 } | 389 } |
| 390 | 390 |
| 391 if (!doc) { | 391 if (!doc) { |
| 392 fprintf(stderr, "Load pdf docs unsuccessful.\n"); | 392 fprintf(stderr, "Load pdf docs unsuccessful.\n"); |
| 393 FPDFAvail_Destroy(pdf_avail); |
| 393 return; | 394 return; |
| 394 } | 395 } |
| 395 | 396 |
| 396 (void)FPDF_GetDocPermissions(doc); | 397 (void)FPDF_GetDocPermissions(doc); |
| 397 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints); | 398 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints); |
| 398 | 399 |
| 399 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); | 400 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); |
| 400 int docType = DOCTYPE_PDF; | 401 int docType = DOCTYPE_PDF; |
| 401 if (FPDF_HasXFAField(doc, &docType) && docType != DOCTYPE_PDF && | 402 if (FPDF_HasXFAField(doc, &docType) && docType != DOCTYPE_PDF && |
| 402 !FPDF_LoadXFA(doc)) { | 403 !FPDF_LoadXFA(doc)) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 } | 562 } |
| 562 | 563 |
| 563 FPDF_DestroyLibrary(); | 564 FPDF_DestroyLibrary(); |
| 564 #ifdef PDF_ENABLE_V8 | 565 #ifdef PDF_ENABLE_V8 |
| 565 v8::V8::ShutdownPlatform(); | 566 v8::V8::ShutdownPlatform(); |
| 566 delete platform; | 567 delete platform; |
| 567 #endif // PDF_ENABLE_V8 | 568 #endif // PDF_ENABLE_V8 |
| 568 | 569 |
| 569 return 0; | 570 return 0; |
| 570 } | 571 } |
| OLD | NEW |