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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 doc = FPDF_LoadCustomDocument(&file_access, NULL); | 465 doc = FPDF_LoadCustomDocument(&file_access, NULL); |
466 } else { | 466 } else { |
467 fprintf(stderr, "Linearized path...\n"); | 467 fprintf(stderr, "Linearized path...\n"); |
468 doc = FPDFAvail_GetDocument(pdf_avail, NULL); | 468 doc = FPDFAvail_GetDocument(pdf_avail, NULL); |
469 } | 469 } |
470 | 470 |
471 (void) FPDF_GetDocPermissions(doc); | 471 (void) FPDF_GetDocPermissions(doc); |
472 (void) FPDFAvail_IsFormAvail(pdf_avail, &hints); | 472 (void) FPDFAvail_IsFormAvail(pdf_avail, &hints); |
473 | 473 |
474 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); | 474 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); |
475 if (!FPDF_LoadXFA(doc)) { | 475 int docType = DOCTYPE_PDF; |
476 fprintf(stderr, "LoadXFA unsuccessful, continuing anyway.\n"); | 476 if (FPDF_HasXFAField(doc, docType)) |
Tom Sepez
2015/03/03 00:53:34
This same test probably has to go into testing/emb
jun_fang
2015/03/03 01:02:31
Shall we remove LoadXFA here?
| |
477 { | |
478 if (docType != DOCTYPE_PDF && !FPDF_LoadXFA(doc)) | |
479 fprintf(stderr, "LoadXFA unsuccessful, continuing anyway.\n"); | |
477 } | 480 } |
478 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); | 481 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); |
479 FPDF_SetFormFieldHighlightAlpha(form, 100); | 482 FPDF_SetFormFieldHighlightAlpha(form, 100); |
480 | 483 |
481 int first_page = FPDFAvail_GetFirstPageNum(doc); | 484 int first_page = FPDFAvail_GetFirstPageNum(doc); |
482 (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints); | 485 (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints); |
483 | 486 |
484 int page_count = FPDF_GetPageCount(doc); | 487 int page_count = FPDF_GetPageCount(doc); |
485 for (int i = 0; i < page_count; ++i) { | 488 for (int i = 0; i < page_count; ++i) { |
486 (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints); | 489 (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
612 RenderPdf(filename, file_contents, file_length, options); | 615 RenderPdf(filename, file_contents, file_length, options); |
613 free(file_contents); | 616 free(file_contents); |
614 } | 617 } |
615 | 618 |
616 FPDF_DestroyLibrary(); | 619 FPDF_DestroyLibrary(); |
617 v8::V8::ShutdownPlatform(); | 620 v8::V8::ShutdownPlatform(); |
618 delete platform; | 621 delete platform; |
619 | 622 |
620 return 0; | 623 return 0; |
621 } | 624 } |
OLD | NEW |