aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf-c.cc
AgeCommit message (Collapse)Author
2022-09-02Disable copying/assigning to QPDF objects, add QPDF::create()Jay Berkenbilt
2022-07-26Code tidy : replace 0 with nullptr or truem-holger
2022-06-19Move C-based ProgressReporter helper into QPDFWriterJay Berkenbilt
2022-06-18Use the default logger for other writes to stdout/stderrJay Berkenbilt
When there is no context for writing output or error messages, use the default logger.
2022-04-30Mark weak encryption with API changes (fixes #576)Jay Berkenbilt
2022-04-30Remove deprecated (pre-8.4.0) encryption APIsJay Berkenbilt
2022-04-24Deprecate replaceOrRemoveKey -- it's the same as replaceKeyJay Berkenbilt
2022-04-16Use anonymous namespaces for file-private classesJay Berkenbilt
2022-04-16Use = default and = delete where possible in classesJay Berkenbilt
2022-04-09Replace PointerHolder with std::shared_ptr in library sources onlyJay Berkenbilt
(patrepl and cleanpatch are my own utilities) patrepl s/PointerHolder/std::shared_ptr/g {include,libqpdf}/qpdf/*.hh patrepl s/PointerHolder/std::shared_ptr/g libqpdf/*.cc patrepl s/make_pointer_holder/std::make_shared/g libqpdf/*.cc patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g libqpdf/*.cc patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh git restore include/qpdf/PointerHolder.hh cleanpatch ./format-code
2022-04-04Programmatically apply new formatting to codeJay Berkenbilt
Run this: for i in **/*.cc **/*.c **/*.h **/*.hh; do clang-format < $i >| $i.new && mv $i.new $i done
2022-02-08WHITESPACE ONLY -- expand tabs in source codeJay Berkenbilt
This comment expands all tabs using an 8-character tab-width. You should ignore this commit when using git blame or use git blame -w. In the early days, I used to use tabs where possible for indentation, since emacs did this automatically. In recent years, I have switched to only using spaces, which means qpdf source code has been a mixture of spaces and tabs. I have avoided cleaning this up because of not wanting gratuitous whitespaces change to cloud the output of git blame, but I changed my mind after discussing with users who view qpdf source code in editors/IDEs that have other tab widths by default and in light of the fact that I am planning to start applying automatic code formatting soon.
2022-02-07Update for clean compile with POINTERHOLDER_TRANSITION=2Jay Berkenbilt
2022-02-06C-API expose QPDFObjectHandle::getKeyIfDictm-holger
2022-02-06C-API expose QPDFObjectHandle::getValueAs... accessorsm-holger
2022-02-05Add qpdf_empty_pdf to C APIJay Berkenbilt
2022-02-05API contract: qpdf_get_qpdf_version() returns a staticJay Berkenbilt
2022-02-04Add a blank line after the first header included in each sourceJay Berkenbilt
2022-02-04PointerHolder: deprecate getPointer() and getRefcount()Jay Berkenbilt
Use get() and use_count() instead. Add #define NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these only. This commit also removes all deprecated PointerHolder API calls from qpdf's code except in PointerHolder's test suite, which must continue to test the deprecated APIs.
2022-02-04C-API add two binary UTF8 funtionsm-holger
add qpdf_oh_new_binary_unicode_string and qpdf_oh_get_binary_utf8_value
2022-01-22Make a few whitespace fixes from last commitm-holger
Commit by ejb@ql.org using m-holger as author so git annotate gives proper credit for changes.
2022-01-22Add new convenience methods QPDFObjectHandle::isNameAndEquals, etcm-holger
Add methods isNameAndEquals, isDictionaryOfType, isStreamOfType
2021-12-20Change names of qpdf_object_type_e enumerationsJay Berkenbilt
They have to be ot_* rather than qpdf_ot_* for compatibility. * Different enumerated types are not assignment-compatible in C++, at least with strict compiler settings * While you can do `constexpr ot_xyz = ::qpdf_ot_xyz` in QPDFObject.hh to make QPDFObject::ot_xyz work, QPDFObject::object_type_e::ot_xyz will only work if the enumerated type names are the same.
2021-12-19Further improvements to handling binary stringsJay Berkenbilt
2021-12-17C API: simplify new error handling and improve documentationJay Berkenbilt
2021-12-17C-API expose QPDFObjectHandle::getTypeCode and getTypeName (fixes #597)m-holger
2021-12-17C API: add several stream functions (fixes #596)Jay Berkenbilt
2021-12-16C API: add functions for working with pages (fixes #594)Jay Berkenbilt
2021-12-16Use value rather than reference captures where possibleJay Berkenbilt
2021-12-10C API: expose functions for indirect objects (fixes #588)Jay Berkenbilt
2021-12-10C API: overhaul error handlingJay Berkenbilt
* Handle error conditions that occur when using the object handle interfaces. In the past, some exceptions were not correctly converted to errors or warnings. * Add more detailed information to qpdf-c.h * Make it possible to work more explicitly with uninitialized objects
2021-12-10Add missing unit test for register progress reporter in C APIJay Berkenbilt
It was exercised in the pdf-linearize example but not in qpdf-ctest.
2021-12-09Refactor trap_errors to use std::functionJay Berkenbilt
2021-12-09C API: qpdf_oh_is_initializedJay Berkenbilt
2021-12-09C API: qpdf_get_last_string_lengthJay Berkenbilt
2021-12-02C-API expose new_object as qpdf_oh_new_objectm-holger
2021-11-19Ensure qpdf_oh handles returned by C-API functions are unique.m-holger
Return new qpdf_oh from qpdf_oh_wrap_in_array when input is already an array. Update some doc comments in qpdf-c.h.
2021-11-11First increment of improving handling of weak crypto (fixes #358)Jay Berkenbilt
2020-12-20Provide qpdf write progress reporting from C API (fixes #487)Jay Berkenbilt
2020-11-29Add QPDFObjectHandle manipulation to C APIJay Berkenbilt
2020-04-03C API: accept any non-zero value as TRUEJay Berkenbilt
2019-06-22In shippable code, favor smart pointers (fixes #235)Jay Berkenbilt
Use PointerHolder in several places where manually memory allocation and deallocation were being used. This helps to protect against memory leaks when exceptions are thrown in surprising places.
2019-06-21Remove implicit conversion from int/pointer to boolJay Berkenbilt
This fixes cases of warning C4800 from msvc
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.
2019-01-17Modernize encryption API for more granularityJay Berkenbilt
Setting encryption permissions for R >= 3 set permission bits in groups corresponding to menu options in Acrobat 5. The new API allows the bits to be set individually.
2018-02-19Add C API for checking PDF filesJay Berkenbilt
2017-09-12Update C API with new QPDFWriter methodsJay Berkenbilt
2017-07-28Convert stream filtering errors to warningsJay Berkenbilt
2017-07-28Convert object parsing errors to warningsJay Berkenbilt
QPDFObjectHandle::parseInternal now issues warnings instead of throwing exceptions for all error conditions that it finds (except internal logic errors) and has stronger recovery for things like invalid tokens and malformed dictionaries. This should improve qpdf's ability to recover from a wide range of broken files that currently cause it to fail.
2015-10-31Implement deterministic IDJay Berkenbilt
For non-encrypted files, determinstic ID generation uses file contents instead of timestamp and file name. At a small runtime cost, this enables generation of the same /ID if the same inputs are converted in the same way multiple times.