summaryrefslogtreecommitdiff
path: root/samples
AgeCommit message (Collapse)Author
2017-03-16Introduce unique_ptr compatible deleters for FPDF typeschromium/3044Tom Sepez
Pre-requisite for easily fixing some leaks in sample code, fuzzers, etc. Kill off some types completely unused in the C API. Change-Id: I67f0a5c6eef63d8e062ca4bc97c9db03970fe337 Reviewed-on: https://pdfium-review.googlesource.com/3095 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-01-31Fixup test harnessdan sinclair
When the results of the test runner were converted to return a tuple the following code which checked the results for true/false were not updated to extract the success value from the tuple. This caused the code to think that the results always passed even when they failed. This CL fixes the two tests which were broken (both just minor image result differences) which slipped in during this breakage. Change-Id: I01b56dd7b05013c2c12c83543746cf59b145e561 Reviewed-on: https://pdfium-review.googlesource.com/2456 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-01-24Fixup coverage builddsinclair
The original coverage CL made the unittests build correclty with coverage but the code in samples/ builds differently. This CL fixes coverage for pdfium_diff and pdfium_test code. Review-Url: https://codereview.chromium.org/2649403003
2017-01-23Remove obsolete include of build_overrides/v8.gnichromium/2991brettw
This file is no longer needed. BUG=684096 Review-Url: https://codereview.chromium.org/2657433002
2017-01-02Gold support in PDFiumchromium/2970stephana
Extends the PDFium tests to collect images and meta data to be uploaded to Gold. This feature is triggered by adding the --gold_* flags. It extends pdfium_test to output the MD5 hash of the underlying pixel buffer for each page it renders. That output is then processed by test_runner.py to generate the gold meta data. This behavior is modeled after the 'dm' tool in skia. See https://skia.googlesource.com/skia/+/master/dm/DM.cpp#1090 This should not cause any change in the current behavior of the tests, it will be trigger once we update the buildbot recipe. BUG=skia:5973 Review-Url: https://codereview.chromium.org/2578893004
2016-11-16Create a subset of skia support for paths onlycaryclark
This is a continuation of https://codereview.chromium.org/2346483006/ This removes the need for agg, without providing full Skia support. It doesn't work yet, but it does compile and run for simple PDFs. R=dsinclair@google.com Committed: https://pdfium.googlesource.com/pdfium/+/5d223298b26c9b2b6284cba9a51521d3873b6e58 Review-Url: https://codereview.chromium.org/2491693002
2016-11-15Revert of Create a subset of skia support for paths only (patchset #10 ↵dsinclair
id:180001 of https://codereview.chromium.org/2491693002/ ) Reason for revert: Breaking the chrome roll. https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/306015/steps/generate_build_files%20%28with%20patch%29/logs/stdio Original issue's description: > Create a subset of skia support for paths only > > This is a continuation of https://codereview.chromium.org/2346483006/ > > This removes the need for agg, without providing > full Skia support. > > It doesn't work yet, but it does compile and run > for simple PDFs. > > R=dsinclair@google.com > > Committed: https://pdfium.googlesource.com/pdfium/+/5d223298b26c9b2b6284cba9a51521d3873b6e58 TBR=dsinclair@google.com,caryclark@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2503883003
2016-11-15Create a subset of skia support for paths onlycaryclark
This is a continuation of https://codereview.chromium.org/2346483006/ This removes the need for agg, without providing full Skia support. It doesn't work yet, but it does compile and run for simple PDFs. R=dsinclair@google.com Review-Url: https://codereview.chromium.org/2491693002
2016-11-14Fix some nits in pdfium_testnpm
Fixed a couple of nits: - Renaming variables with correct format. - Add comments regarding the fact that pages are 0-based. Review-Url: https://codereview.chromium.org/2499143003
2016-11-14Add --pages option in pdfium_test so it renders only some of the pages.chromium/2920npm
The --pages option is set up to be 0-indexed. --pages=<number> will render the specific page. --pages=<number>-<number> will render the range of pages given. Review-Url: https://codereview.chromium.org/2495333002
2016-10-13Reduce missing evt file spam in pdfium_test.thestig
Review-Url: https://codereview.chromium.org/2415663003
2016-10-05Remove ownership of CPDFSDK_Document from CPDFXFA_Documentdsinclair
This CL updates CPDFXFA_Document so it never owns the CPDFSDK_Document. The CPDFSDK_Document is now always owned by the CPDFXFA_Environment. This also cleans up the strange need to reverse the order of document and form destruction when using XFA. Review-Url: https://codereview.chromium.org/2397473006
2016-09-28Fix leaks in pdfium_test.thestig
Review-Url: https://codereview.chromium.org/2375263002
2016-09-21Avoid static initializers and global variables in 'pdfium_test'.tonikitoo
This CL aims to follow up on thestig's past-land feedback receveid on https://codereview.chromium.org/2277063003/#msg15 . In order to avoid static initializers and global data declaration, CL adds a data struct named PDFiumTest_FPDF_FORMFILLINFO, which has FPDF_FORMFILLINFO as the first struct member definition. This allows the use of reinterpret_cast to/from PDFiumTest_FPDF_FORMFILLINFO and PDF_FORMFILLINFO. PDFiumTest_FPDF_FORMFILLINFO also two more struct members, 'loadedPages' and 'formHandle', which were previously global variables. Review-Url: https://codereview.chromium.org/2330043002
2016-09-09Define behaviors of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw.chromium/2858chromium/2857chromium/2856jaepark
Previously, PDFium only supported widget annotations to draw forms. As we've implemented other annotations, the behavior of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw changed. So, this CL clearly defines what needs to be done in FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw. This CL first assumes that PDFium users will always call FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw to render PDF pages, because otherwise they are not able to support PDF forms. FPDF_RenderPageBitmap_Retail should only deal with non-widget annotations, such as highlight, underline, text, etc. If FPDF_ANNOT flag is passed, non-widget annotations are drawn. Otherwise, they are hidden. FPDF_FFLDraw should only deal with annotations that requires user-interaction, such as widget annotations and popup annotation. Since popup annotation is associated with non-widget annotation, they should not be drawn if the associated annotation is hidden. Thus, if FPDF_ANNOT flag is passed, popup annotations are drawn. Otherwise, they are hidden. Widget annotations should be always drawn regardless of FPDF_ANNOT flag since they need to be always displayed for PDF forms. Also, roll DEPS for testing/corpus to 8485b30. BUG=pdfium:594 Review-Url: https://codereview.chromium.org/2323203002
2016-08-26Remove most things GYP.thestig
BUG=pdfium:559 Review-Url: https://codereview.chromium.org/2286653002
2016-08-26Extend pdfium_test capability so that more Javascript can be executedchromium/2841tonikitoo
In [1], the lack of support of pdfium_test to some application level hooks was felt. More specifically, the lack of implementation of the hook FFI_GetPage, called when 'this.getAnnot()' is executed in an Acrobar JS context, makes it non-trivial to JS texts that manipulate PDF annotations. [1] https://codereview.chromium.org/2265313002/ Here is the failing call stack in pdfium_test: 0 ::RenderPdf (samples/pdfium_test.cc) 1 ::FORM_DoDocumentOpenAction (fpdfsdk/fpdfformfill.cpp) 2 CPDFSDK_Document::ProcOpenAction (fpdfsdk/fsdk_mgr.cpp) 3 CPDFSDK_ActionHandler::DoAction_DocOpen (fpdfsdk/fsdk_actionhandler.cpp) <----v8----> 4 Document::getAnnot (fpdfsdk/javascript/Document.cpp) 5 CPDFSDK_Document::GetPageView (fpdfsdk/fsdk_mgr.cpp) 6 CPDFDoc_Environment::FFI_GetPage (fpdfsdk/include/fsdk_mgr.h) (frame 6 returns nullptr, and getAnnot call in frame 4 bails) CL extends pdfium_test app with a FFI_GetPage hook implementation. Basically what FFI_GetPage does is returning a FPDF_PAGE instance. In case of pdfium_test, FPDF_PAGE instances were only created on demand when the page was going to get rendered, and then discarded. Since FFI_GetPage can be called by JS before pages are rendered, CL moved the page creation code into a helper function, and cached the FPDF_PAGE instances created in a map, so it does not recreate them needlessly. BUG=pdfium:492 Review-Url: https://codereview.chromium.org/2277063003
2016-07-15Clean up some nits in pdfium_test.cc.thestig
TBR=weili@chromium.org Review-Url: https://codereview.chromium.org/2149773003
2016-06-27Fix memory leaks with V8 startup data.thestig
Review-Url: https://codereview.chromium.org/2068563002
2016-06-16Add text dump to pdfium_test.dsinclair
This Cl adds a '--txt' flag to pdfium_test. When provided the text from the PDF will be extracted and written into page numbered text files. The files are written in UTF32-LE as that's what FPDFText_GetUnicode() provides. Review-Url: https://codereview.chromium.org/2060983005
2016-06-09Roll V8 and its deps and update ICU initialization callchromium/2764jochen
R=machenbach@chromium.org,thestig@chromium.org BUG= Review-Url: https://codereview.chromium.org/2053603002
2016-05-19Fix memory leaks in pdfium_test.thestig
BUG=603903 Review-Url: https://codereview.chromium.org/1994113002
2016-05-11fix skia buildcaryclark
Fix some bit rot with the Skia build; update the gypi to current and switch a deprecated call for the current one. R=tsepez@chromium.org Review-Url: https://codereview.chromium.org/1958263002
2016-05-04Fix event sending in pdfium_test.tsepez
Passing bad args in pdfium_test -- all void* pointers look alike. Make output less verbose while we're here. Turn on event sending mode for corups tests. No effect until .evt files added to corpus. Review-Url: https://codereview.chromium.org/1946873004
2016-04-30Revert of Allow overriding GN build flags (patchset #2 id:20001 of ↵dsinclair
https://codereview.chromium.org/1923333002/ ) Reason for revert: Blocking the roll Original issue's description: > Allow overriding GN build flags > > In order to enable XFA from GN builds we need to be able to override > pdf_enable_xfa. To do this a build_overrides/pdfium.gni file needs to be created > in Chrome. To use that, we have to create a build_overrides/pdfium.gni file > in PDFium that just uses the default values. > > BUG=chromium:62400 > > Committed: https://pdfium.googlesource.com/pdfium/+/1ae572e7e35b52ce4897d1715c005a1b0f79526a TBR=thakis@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=chromium:62400 Review-Url: https://codereview.chromium.org/1941563002
2016-04-27Adding default_exe_manifest to two binariesbrucedawson
gn builds are missing Windows manifests for pdfium_diff.exe and pdfium_test.exe. These manifests are necessary in order to get predictable behavior on Windows. BUG=602505 Review-Url: https://codereview.chromium.org/1927593003
2016-04-27Allow overriding GN build flagsdsinclair
In order to enable XFA from GN builds we need to be able to override pdf_enable_xfa. To do this a build_overrides/pdfium.gni file needs to be created in Chrome. To use that, we have to create a build_overrides/pdfium.gni file in PDFium that just uses the default values. BUG=chromium:62400 Review-Url: https://codereview.chromium.org/1923333002
2016-04-26Roll v8 to 0ff89ea7 and update gyp referencesmachenbach
Contents: https://chromium.googlesource.com/v8/v8/+log/47bcec78..0ff89ea75 BUG=chromium:606547 Review URL: https://codereview.chromium.org/1920863003
2016-04-20Standalone GN build.dsinclair
This CL setups up a standalone GN build. You'll need to set gn args similar to: use_goma = true clang_use_chrome_plugins = false pdf_enable_xfa = true pdf_enable_v8 = true pdf_is_standalone = true The third_party/pymock files are needed to make git cl upload work correctly. BUG=pdfium:106 Review URL: https://codereview.chromium.org/1904563002
2016-04-18Allow pdfium_test to send simple events to each page.tsepez
We add the --send-events flag, which causes pdfium_test to look for a .evt file with the same base name as the .pdf file being rendered, and to use its contents to drive calls to FORM_* APIs. The .evt file syntax is crude, roughly: # comments keycode,65 mousedown,right,300,300 # more comments mouseup,right,300,300 mousemove,300,300 Review URL: https://codereview.chromium.org/1898993002
2016-03-31Move the fpdfsdk/include/javascript folderdsinclair
This CL splits the IJavaScript.h file into the two inner classes and puts them in the fpdfsdk/javascript folder. Review URL: https://codereview.chromium.org/1847583004
2016-03-15core/include/fdpfapi cleanup Part I.Dan Sinclair
This Cl moves a bunch of the files from core/include/fpdfapi to their correct location outside the core/include tree. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1805603002 .
2016-03-14Fix build error due to commit 399be5bWei Li
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1799913002 .
2016-03-14Add bitmaps and skp output to Skia portCary Clark
This is a first-cut at supporting bitmaps. Also added a --skp option to pdfium_test to generate a Skia picture file. The picture file can be loaded in Skia's SampleApp, debugger, or skiaserver to examine the generated picture. (This also includes fixes suggested in the prior Skia CL. My apologies for fat-fingers abandoning that one.) R=dsinclair@chromium.org, tsepez@chromium.org, dsinclair Review URL: https://codereview.chromium.org/1776313002 .
2016-03-02Rename png_ functions conflicting with chrome.Tom Sepez
Part of the work required to ship XFA with chrome. BUG=pdfium:396 R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1763493002 .
2016-03-01Fix and enable lint checks.Dan Sinclair
This CL fixes and enables: * readability/namespace * readability/multiline_string * readability/multiline_comment * readability/inheritance * readability/function * readability/braces R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1747123002 .
2016-02-24Fixing whitespace lint errors.Dan Sinclair
This CL enables several of the diabled whitelist/* lint checks. R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1730553002 .
2016-02-18Fixup incorrect include guards.Dan Sinclair
This CL updates include guards throughout the code base to be in the chromium style. BUG=pdfium:65 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1707893004 .
2016-02-17Expand all paths to be based off pdfium/ directoryDan Sinclair
This CL runs a script over the source and updates the include files to be a full path from the pdfium/ directory. BUG=pdfium:65 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1707923002 .
2016-02-01Merge to XFA: Use JS_ExpandKeywordParams() in app.response()Tom Sepez
Original Review URL: https://codereview.chromium.org/1654523002 . (cherry picked from commit 3859258ebe9e81e1f766b57e7f78c786ae4ed495) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1658753002 .
2016-01-29Merge to XFA: Fix botched "CC:" parameter passing in JS_DocmailForm().Tom Sepez
Original Review URL: https://codereview.chromium.org/1645413002 . (cherry picked from commit 6902db5cbaf0afb8f2cb4df325e1a4e7d6acd53f) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1648793006 .
2016-01-29Merge to XFA: Fix behaviour of app.alert() with a single object argument.Tom Sepez
Original Review URL: https://codereview.chromium.org/1641693003 . (cherry picked from commit 66519af52b61ca158044651d0507d47efb364f87) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1639253008 .
2016-01-27XFA: Fix checkdeps violations.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1647613003 .
2016-01-15XFA: Rename libpng to libpng16.chromium/2625chromium/2624Lei Zhang
Otherwise this conflicts with Chromium's copy if the include paths just happens to be in the wrong order. Since the two copies of libpng are of different versions, we cannot use Chromium's copy. TBR=tsepez@chromium.org,ochang@chromium.org Review URL: https://codereview.chromium.org/1599513004 .
2016-01-15Merge to XFA: Make pdfium_test report build options.Tom Sepez
Review URL: https://codereview.chromium.org/1587023005 . (cherry picked from commit 041ed75701d1edc15923daf6080224a67b480869) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1595763002 .
2016-01-15XFA: Upgrade libpng to 1.6.20.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1591483003 .
2016-01-06Merge to XFA: Return unique_ptrs from test_support functionsTom Sepez
Orignal Review URL: https://codereview.chromium.org/1563513002 . (cherry picked from commit aa326bd6b169dc1b5b9b83048c71799799ab34c6) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1564583004 .
2016-01-05Merge to XFA: Make FPDF_WIDESTRING work regardless of endianness.Tom Sepez
Original Review URL: https://codereview.chromium.org/1554363002 . (cherry picked from commit ed34cdf99d5a4b33e57f81f9244a311f6fb86db3) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1559373002 .
2015-12-31Merge to XFA: Reapply "Fix a partial rendering problem"Lei Zhang
This reverts commit 054fc955c153eb5c581fd14946848b8b2a77136a. Additionally, this rolls DEPS for the testing corpus to update test expectations. BUG=pdfium:336 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1555833002 . (cherry picked from commit 5594538fcc96c38db34f336223140cf703e3cca0) Review URL: https://codereview.chromium.org/1553013002 .
2015-12-22Merge to XFA: Start using allowed C++11 features.Lei Zhang
TBR=dml@google.com, thakis@chromium.org Review URL: https://codereview.chromium.org/1544923002 . Review URL: https://codereview.chromium.org/1545823002 . (cherry picked from commit ba2586d2c0a50df14aa2549a0a841e1d4b9af4b6) (cherry picked from commit 87f7d29531dabfd66e547a6be31a08272ff631d5) Review URL: https://codereview.chromium.org/1542213002 .