summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot_embeddertest.cpp
AgeCommit message (Collapse)Author
2017-06-27Made existing annotation APIs to work with APchromium/3143Jane Liu
1. Modified some existing annotation APIs to take into account the effect of annotation's appearance streams. * Added an embedder test testing annotations with APs. This CL is refactored out of https://pdfium-review.googlesource.com/c/6676/. Bug=pdfium:737 Change-Id: I27d5e66dfdb90038d147cab1a26e0bf86b324982 Reviewed-on: https://pdfium-review.googlesource.com/7030 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-27Changed the return type for annotation APIsJane Liu
Before: When returning FPDF_ANNOTATION, the APIs would take in a FPDF_ANNTOATION* and write the handle of the annotation to it, while returning a boolean as status. This CL: This CL changes the APIs to directly return FPDF_ANNOTATION, which would be null on failure. Also adds more null checks within the annotation APIs. Bug=pdfium:737 Change-Id: I4f77dd1b16d43eab3f16c303598b76591da0dcab Reviewed-on: https://pdfium-review.googlesource.com/6952 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-22Minor change to AP generation logicJane Liu
Current behavior: Our CPVT_GenerateAP::Generate*AP() functions do not get called as long as the annotation dictionary has an "AP" entry. Problem: We always need the "N" entry in AP dictionary to display an annotation. Even though the spec requires "AP" dictionary to have an "N" entry for normal mode appearance, in case of a malformed pdf with "AP" but without "N" in "AP", we won't be able to display the annotation at all. Fix: Always check if "AP" has "N" entry to decide whether AP needs to be generated. If not, then we still need to generate AP, and add to the AP dictionary under the key "N". Bug=pdfium:778 Change-Id: Icf0c6a681b3c8c22b0b67bf8d16ce6fefdc2c45b Reviewed-on: https://pdfium-review.googlesource.com/6692 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-20Wrapper class for annotation dictionary + CPDF_Formchromium/3137Jane Liu
Simple wrapper class for annotation + its path parsing form object. This will be used in APIs for extracting and setting annotation paths. Bug=pdfium:737 Change-Id: I2e8131672d087613213735295c6d01e377b956e7 Reviewed-on: https://pdfium-review.googlesource.com/6730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-14Reenabled a flaky testchromium/3131Jane Liu
Reenabling since can't reproduce failure any more. Bug=pdfium:747 Change-Id: I347a994e0a6b389d39162075f7d5d94ae0048984 Reviewed-on: https://pdfium-review.googlesource.com/6590 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-09Disable a new flaky testJane Liu
Bug=pdfium:747 Change-Id: I51656750e5e5e7f7cecefc5244a66333a0213f19 Reviewed-on: https://pdfium-review.googlesource.com/6433 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-07Fixing FPDFPage_TransformAnnotsJane Liu
Came across this error in FPDFPage_TransformAnnots, where SetNewAt() would fail on a bound assertion when a newly created array calls it. This CL contains a fix in the function and adds an embedder test for this. Bug=pdfium:745 Change-Id: I569f225598d956d270ef8f11ee3225acf48aadc7 Reviewed-on: https://pdfium-review.googlesource.com/6353 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-06-07Basic APIs and tests for creating annotationsJane Liu
1. Added API for adding annotations and modifying common annotation properties * Added three embedder tests covering all of the API functions. Bug=pdfium:737 Change-Id: I369d9e17f589f896f9e8c672382f082e524ae534 Reviewed-on: https://pdfium-review.googlesource.com/6351 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-01Basic APIs and tests for extracting annotationsJane Liu
1. Added API for extracting annotation properties: * Added testing flag "--annot" that outputs the annotation properties into a .txt file. * Added two embedder tests covering all the API functions. Bug=pdfium:737 Change-Id: I95943a9b2b3d5d431bc8a74a31b27b4f4b521026 Reviewed-on: https://pdfium-review.googlesource.com/6092 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>