Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: samples/pdfium_test.cc

Issue 732173003: Log message when XFA load fails (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 doc = FPDF_LoadCustomDocument(&file_access, NULL); 284 doc = FPDF_LoadCustomDocument(&file_access, NULL);
285 } else { 285 } else {
286 printf("Linearized path...\n"); 286 printf("Linearized path...\n");
287 doc = FPDFAvail_GetDocument(pdf_avail, NULL); 287 doc = FPDFAvail_GetDocument(pdf_avail, NULL);
288 } 288 }
289 289
290 (void) FPDF_GetDocPermissions(doc); 290 (void) FPDF_GetDocPermissions(doc);
291 (void) FPDFAvail_IsFormAvail(pdf_avail, &hints); 291 (void) FPDFAvail_IsFormAvail(pdf_avail, &hints);
292 292
293 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks); 293 FPDF_FORMHANDLE form = FPDFDOC_InitFormFillEnvironment(doc, &form_callbacks);
294 FPDF_LoadXFA(doc); 294 if (!FPDF_LoadXFA(doc)) {
295 printf("LoadXFA unsuccessful, continuing anyway.\n");
296 }
295 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD); 297 FPDF_SetFormFieldHighlightColor(form, 0, 0xFFE4DD);
296 FPDF_SetFormFieldHighlightAlpha(form, 100); 298 FPDF_SetFormFieldHighlightAlpha(form, 100);
297 299
298 int first_page = FPDFAvail_GetFirstPageNum(doc); 300 int first_page = FPDFAvail_GetFirstPageNum(doc);
299 (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints); 301 (void) FPDFAvail_IsPageAvail(pdf_avail, first_page, &hints);
300 302
301 int page_count = FPDF_GetPageCount(doc); 303 int page_count = FPDF_GetPageCount(doc);
302 for (int i = 0; i < page_count; ++i) { 304 for (int i = 0; i < page_count; ++i) {
303 (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints); 305 (void) FPDFAvail_IsPageAvail(pdf_avail, i, &hints);
304 } 306 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } else { 409 } else {
408 RenderPdf(filename, pBuf, len, format); 410 RenderPdf(filename, pBuf, len, format);
409 } 411 }
410 free(pBuf); 412 free(pBuf);
411 } 413 }
412 414
413 FPDF_DestroyLibrary(); 415 FPDF_DestroyLibrary();
414 416
415 return 0; 417 return 0;
416 } 418 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698