summaryrefslogtreecommitdiff
path: root/public
AgeCommit message (Collapse)Author
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-22Updated FPDF_GetMetaText doc string for linearized files.Henrique Nakashima
Bug: pdfium:664 Change-Id: Iae8dab8c27d087c66b4e883a17e9fe55fe975e30 Reviewed-on: https://pdfium-review.googlesource.com/6836 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-06-20Add FORM_GetSelectedText() function.Diana Gage
This function copies the selected text from a form text field or form combobox text field into the buffer parameter and returns the length of the selected text string. When buffer is a nullptr or buflen is less than the length of the selected text, this function does not modify the buffer and only returns the selected text length. BUG=chromium:59266 Change-Id: Ie77de38e45bbe6f9ea033826c961435304eedfc7 Reviewed-on: https://pdfium-review.googlesource.com/6413 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
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-19Added public API FPDFPath_GetStrokeColorJane Liu
There is already public APIs for SetFillColor, GetFillColor, and SetStrokeColor; this is the only one missing. This function is helpful to have when extracting path information from annotations. Change-Id: I2bf80a1dc5433e65bbb1d005c0e609d01c9133be Reviewed-on: https://pdfium-review.googlesource.com/6710 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-06-14Add blend to GraphicsDataNicolas Pena
CL [1] added the ability to set the blend mode for a page object. This CL adds the corresponding component to GraphicsData since the blend mode is part of ExtGSState. In addition, a test using the SetBlendMode method is added. [1] https://pdfium-review.googlesource.com/c/5953/ Bug: pdfium:720 Change-Id: I49120284345185c200a45cc3b37ec59f0658e2dc Reviewed-on: https://pdfium-review.googlesource.com/6510 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-14Remove deprecated FPDPage_HasFormFieldAtPoint().Lei Zhang
It has been deprecated for 2 years now. Use FPDFPage_HasFormFieldAtPoint() instead. Change-Id: I1a5f88b404fbda40f491f9d2001ef3e7788e95a0 Reviewed-on: https://pdfium-review.googlesource.com/6551 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-13Fix FPDFAction_GetFilePath() documentation error.Lei Zhang
Commit 5f597db5 accidentally changed this. Probably due to copy/pasting. Change-Id: I41f6876da28d5d744d6d169c67b33399893e3585 Reviewed-on: https://pdfium-review.googlesource.com/6416 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-09Minor changes/addons for annotation APIsJane Liu
As per Lei's comments while looking back at annotation API CLs to attempt to fix Bug 747. Bug=pdfium:737 Change-Id: I96369bf8dcc7afdf49e9a137e7bcba4ff1aeef67 Reviewed-on: https://pdfium-review.googlesource.com/6431 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
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>
2017-06-01Add public #defines for line cap and line join values.wileyrya
Change-Id: I7a26e288410b4bce0be1779b1d4cec7eb1243945 Reviewed-on: https://pdfium-review.googlesource.com/6171 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-05-26Add public API for setting the blend mode on a page object.wileyrya
BUG=pdfium:720 R=npm@chromium.org Change-Id: I2a43b34da6946265ca06502b9ff19ad352fd18cb Reviewed-on: https://pdfium-review.googlesource.com/5953 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-05-26Add public API for getting the bounds of a page object.wileyrya
BUG=pdfium:721 R=npm@chromium.org Change-Id: I71b6281346b3ed67f6b8703eccd7794588559819 Reviewed-on: https://pdfium-review.googlesource.com/6013 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-05-26Add public API for setting the fill color on a text objectwileyrya
BUG=pdfium:719 R=npm@chromium.org Change-Id: Ifd9330de265f8419d588b65fbd6a6187f17badd1 Reviewed-on: https://pdfium-review.googlesource.com/5950 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-26Add public API for setting LineJoin and LineCap on a pathwileyrya
BUG=pdfium:718 R=npm@chromium.org Change-Id: Icdc1546c87a676a7d05330dece2c5eacd92c0c92 Reviewed-on: https://pdfium-review.googlesource.com/5951 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-17Use more static_cast in fpdfsdkNicolas Pena
This CL replaces some reinterpret_cast with static_cast in fpdfsdk. It also removes an obsolete comment in fpdfedit.h Change-Id: I36c29bfcd6382490a8c955b50ccfa4c93ab351c7 Reviewed-on: https://pdfium-review.googlesource.com/5632 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-05-16Be skeptical of bare |new|s.Tom Sepez
In particular, prefer an explicit .release() call when handing ownership of an object to a caller across a C-API. Change-Id: Ic3784e9d0b2d378a08d388989eaea7c9166bacd1 Reviewed-on: https://pdfium-review.googlesource.com/5470 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-05-09Remove FPDFPageObj_NewImgeObj().Lei Zhang
Callers should use FPDFPageObj_NewImageObj() instead. Change-Id: If9f262af771344799a372645e466d3b8e64482ed Reviewed-on: https://pdfium-review.googlesource.com/5153 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-05-08Add raw PostScript output to pdfium_test on Windows.Lei Zhang
Activated by --ps2 and --ps3 for PostScript level 2 and 3, respectively. The raw output is not formatted in a way for most PostScript processing tools to recognize as actually PostScript. Also fix the type of the parameter to FPDF_SetPrintPostscriptLevel() even though it ends up being a no-op. Change-Id: Iaa34fd3dfaedad2b016fefe1227cbed9c974ae2a Reviewed-on: https://pdfium-review.googlesource.com/4996 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-02Add API to create a text object using a loaded font.Nicolas Pena
There is already a method to add text from standard font, this CL adds an option to add text using a loaded font. The font set into a text object is ref counted and may be released, so call LoadFont on this new text obj, and add a method to close the font. This CL also improves the SetText method so that it now uses a WideString, in preparation for CID fonts with non-Latin characters. Bug: pdfium:667 Change-Id: I6829d702357d2a898a12f5297e4fd2ec993a9891 Reviewed-on: https://pdfium-review.googlesource.com/4770 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-04-08Add title (/T) extraction for PDF tagged structureschromium/3067chromium/3066dan sinclair
This CL adds the ability to extract the title from a tagged structure element if one exists. Bug: pdfium:672 Change-Id: I22e2a8371db4f08b8a70dd77002f1befab97f530 Reviewed-on: https://pdfium-review.googlesource.com/3819 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-05Add option to pdfium_test to dump structure elementsDan Sinclair
This Cl adds a --show-structure to pdfium_test which will dump out the StructElement items for the selected pages. Bug: pdfium:672 Change-Id: I90aceda71c13c54abfe4ac242a62375643cdfd9d Reviewed-on: https://pdfium-review.googlesource.com/3750 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-05Add public method FPDFPath_GetFillColor to get fill color of a path object.Miklos Vajna
It was already possible to set the fill color, this is the other direction. Change-Id: Id53f3c9969ca036ec1f9383a2cdbaf224395215f Reviewed-on: https://pdfium-review.googlesource.com/3690 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-04Add method to get tagged typeDan Sinclair
This CL adds a FPDF_StructElement_GetType method to get the type of a given tagged struct. This corresponds to the /S key in the structure element dictionary. See PDF1.7 Table 10.10. Bug: pdfium:672 Change-Id: I313eb886dc9623715995d73a76bce01ba9985e4b Reviewed-on: https://pdfium-review.googlesource.com/3623 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-04-03Add public method FPDFPageObj_GetType to get type of a page object.Miklos Vajna
The possible return values were already part of the public header in the form of a set of defines. Change-Id: I040e0f330fdd7a3cd29f74fc6ee06d122afd2dd0 Reviewed-on: https://pdfium-review.googlesource.com/3570 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
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-03-16Move FPDFImageObj_LoadJpegHelper() into an anonymous namespace.Lei Zhang
Add public FPDFPageObj_NewImageObj() call to replace FPDFPageObj_NewImgeObj() which is missing a letter. Change-Id: I5355ee5e5bf7e6e161e2004ec7e9257c85a463f7 Reviewed-on: https://pdfium-review.googlesource.com/2840 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-03-10Add public method FPDFText_GetTextIndexFromCharIndexNicolas Pena
BUG=pdfium:676 Change-Id: I46de35a86769dc2f7f73ac3552306356ca3289a5 Reviewed-on: https://pdfium-review.googlesource.com/2955 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-03-06Add public method FPDFText_LoadFont to load some types of fonts.Nicolas Pena
The new method replaces the previous one for loading only type1 fonts. This will create the font dictionary with the very basics needed, according to the tables in chapter 5 of the PDF spec. The tests for now are only checking that the information is getting passed on properly. Followup: adding text with those fonts, generating the contents (doing that will allow testing whether the parts that I've skipped like Encoding and cmaps are needed or not). BUG=pdfium:667 Change-Id: Id1a61501e09542804a391552fd002f2caed41939 Reviewed-on: https://pdfium-review.googlesource.com/2915 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-02-27Add public API for creating a Type1 fontNicolas Pena
Given a stream of data, we create a type1 font and fill up the required dictionary entries according to PDF spec 1.7. Table 5.8 describes Type 1 font dictionaries, and Table 5.19 describes font descriptors. BUG=pdfium:667 Change-Id: I571b09fb533467d77ed0104e613726387aec1f87 Reviewed-on: https://pdfium-review.googlesource.com/2835 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-02-27Fix nits from commit db764708.Lei Zhang
- Constify test data - ASSERT_EQ() buffer size - EXPECT_EQ() arguments are reversed - Fix typos in comments Change-Id: I846bfcc29bbf43d0a8b333250d1cce1aae5a8d59 Reviewed-on: https://pdfium-review.googlesource.com/2841 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-02-15Add public API for adding text with standard fontsNicolas Pena
BUG=pdfium:667 Change-Id: I05e301385a7af4b6ce27dc0b885e23646abf3dd9 Reviewed-on: https://pdfium-review.googlesource.com/2711 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-02-10Add line width option for stroking pathschromium/3011chromium/3010chromium/3009Nicolas Pena
BUG=pdfium:661 Change-Id: Ie1dc82a1323a35ebbd63a5b7b8f8c95f9a5325fe Reviewed-on: https://pdfium-review.googlesource.com/2613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-02-07Add APIs for path construction and paintingchromium/3006Nicolas Pena
Added methods to create paths, set their colors, determine whether they will be stroked and/or filled. FPDFPage_InsertObject should be used to add a path to a page. BUG=pdfium:661 Change-Id: I8fd17b33a09c5126e517bfd1a69a893216c160e8 Reviewed-on: https://pdfium-review.googlesource.com/2534 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-01-12Add postscript pathrbpotter
This patch adds the additional functions required to make postscript printing functional. The most significant additions are are two added compression functions and a new API for setting the postscript level. Not currently called from Chromium, Chromium patch to come. BUG= Review-Url: https://codereview.chromium.org/2612243005
2016-12-14Add inline JPEGs.rbpotter
Allows JPEG data to be copied into the file rather than left in a separate file. This is needed to allow rasterized PDFs to avoid saving image files for each page. See Chromium issue 2524143003 for chromium changes. BUG=534945, 550205, 480628 Review-Url: https://codereview.chromium.org/2529543003
2016-12-06Fix FPDF_GetPageLabel API typo.dsinclair
The API was originally committed as FPDF_GetPagelLabel but should be FPDF_GetPageLabel. BUG=pdfium:479 Review-Url: https://codereview.chromium.org/2559513002
2016-11-23Add FPDF_RenderPageBitmapWithMatrix API.thestig
BUG=pdfium:522 Review-Url: https://codereview.chromium.org/2526473002
2016-11-23Add APIs for limited use of document tagged code.thestig
BUG=pdfium:568 Review-Url: https://codereview.chromium.org/2519343002
2016-11-23Add API for getting page labels.thestig
BUG=pdfium:479 Review-Url: https://codereview.chromium.org/2521843003
2016-11-21Fixup lint flags.Dan Sinclair
The -build/include setting was masking out build/include_what_you_use. This CL restores them, fixes any build errors, and adds NOLINT as needed. As well, the runtime/explicit and runtime/printf flags are aslo enabled and NOLINT'd. lint cleanups Change-Id: Ib013b3eb29c8d0e48cad74c5df9028684130719f Reviewed-on: https://pdfium-review.googlesource.com/2030 Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-16Continue formatting fwl/coredsinclair
Review-Url: https://codereview.chromium.org/2510793003
2016-11-08Add FPDF_FreeDefaultSystemFontInfo APInpm
Added method that will cast into FPDF_SYSFONTINFO_DEFAULT and delete. This will allow using FPDF_GetDefaultSystemFontInfo() without memory management problems. Review-Url: https://codereview.chromium.org/2485283002
2016-11-08Add FPDFDest_GetLocationInPage APIdsinclair
Add an API to get the value of the /XYZ destination parameter. This CL was originally from https://codereview.chromium.org/1960193003/ by halcanary@. Review-Url: https://codereview.chromium.org/2481743004
2016-11-04Implement FPDF_VIEWERREF_GetName() API.chromium/2910thestig
This is a generic API function to retrieve any viewer preference of type name. BUG=pdfium:414 Review-Url: https://codereview.chromium.org/2475923003
2016-09-14Remove FFI_ from CPDFSDK_Environment method namesdsinclair
The prefix doesn't add anything when used in CPDFSDK_Environment, remove. Review-Url: https://codereview.chromium.org/2338303002
2016-09-14Cleanup CPDFXFA_Document.dsinclair
Remove unused params and methods. Cleanup formatting. Review-Url: https://codereview.chromium.org/2322003002
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-19Fix an embedder test with leaked page objectchromium/2836chromium/2835weili
The public API FPDFPage_New() incorrectly said to use FPDFPage_Delete() instead of FPDF_ClosePage() to free the new page. This led to a page object leak in an embedder test. Correct the public API description as well as its usage in the embedder test. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2260683003