| 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 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 if (FPDFAvail_IsLinearized(pdf_avail)) { | 478 if (FPDFAvail_IsLinearized(pdf_avail)) { |
| 479 fprintf(stderr, "Linearized path...\n"); | 479 fprintf(stderr, "Linearized path...\n"); |
| 480 doc = FPDFAvail_GetDocument(pdf_avail, nullptr); | 480 doc = FPDFAvail_GetDocument(pdf_avail, nullptr); |
| 481 } else { | 481 } else { |
| 482 fprintf(stderr, "Non-linearized path...\n"); | 482 fprintf(stderr, "Non-linearized path...\n"); |
| 483 doc = FPDF_LoadCustomDocument(&file_access, nullptr); | 483 doc = FPDF_LoadCustomDocument(&file_access, nullptr); |
| 484 } | 484 } |
| 485 | 485 |
| 486 if (!doc) { | 486 if (!doc) { |
| 487 fprintf(stderr, "Load pdf docs unsuccessful.\n"); | 487 fprintf(stderr, "Load pdf docs unsuccessful.\n"); |
| 488 FPDFAvail_Destroy(pdf_avail); |
| 488 return; | 489 return; |
| 489 } | 490 } |
| 490 | 491 |
| 491 (void)FPDF_GetDocPermissions(doc); | 492 (void)FPDF_GetDocPermissions(doc); |
| 492 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints); | 493 (void)FPDFAvail_IsFormAvail(pdf_avail, &hints); |
| 493 | 494 |
| 494 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); | 495 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); |
| 495 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); | 496 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); |
| 496 FPDF_SetFormFieldHighlightAlpha(form, 100); | 497 FPDF_SetFormFieldHighlightAlpha(form, 100); |
| 497 | 498 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 658 } |
| 658 | 659 |
| 659 FPDF_DestroyLibrary(); | 660 FPDF_DestroyLibrary(); |
| 660 #ifdef PDF_ENABLE_V8 | 661 #ifdef PDF_ENABLE_V8 |
| 661 v8::V8::ShutdownPlatform(); | 662 v8::V8::ShutdownPlatform(); |
| 662 delete platform; | 663 delete platform; |
| 663 #endif // PDF_ENABLE_V8 | 664 #endif // PDF_ENABLE_V8 |
| 664 | 665 |
| 665 return 0; | 666 return 0; |
| 666 } | 667 } |
| OLD | NEW |