Commit Graph

116 Commits

Author SHA1 Message Date
m-holger aa2e0d23f0 In QPDFWriter::writeLinearized use object table obj in call to getLinearizedParts 2024-03-08 10:41:24 +00:00
m-holger ccad589f7d In QPDFWriter replace map xref with new ObjTable new_obj 2024-03-08 10:05:57 +00:00
m-holger 2fa93e79b4 In QPDFWriter replace map object_to_object_stream with ObjTable obj 2024-03-08 09:59:56 +00:00
m-holger 84e25919cb In QPDFWriter replace map obj_renumber_no_gen with ObjTable obj 2024-03-08 09:36:47 +00:00
m-holger 8791b5f8d0 In QPDFWriter replace map obj_renumber with a new object table obj 2024-03-08 09:36:22 +00:00
Jay Berkenbilt 9db5d75b2b Update copyright to 2024 2024-01-01 10:56:06 -05:00
Jay Berkenbilt 8854143c7b Spell check 2023-10-07 17:52:35 -04:00
m-holger 0ac005f0d9 Code tidy - Clang-Tidy rule modernize-use-override 2023-06-09 15:52:56 +01:00
m-holger acd0acf169 Fix doc typos 2023-06-02 19:24:12 +01:00
m-holger 3c5700c255 Code tidy - reflow comments and strings 2023-06-02 16:00:40 +01:00
Jay Berkenbilt 60965d5f4d Rerun clang-format 2023-05-21 13:35:09 -04:00
Jay Berkenbilt d740c6ccce Rerun format_code (after merging clang-tidy PR) 2023-05-20 14:52:19 -04:00
m-holger ba5a3567a2 Remove redundant 'virtual' specifiers 2023-05-20 15:41:52 +01:00
m-holger d0682f0f60 Use nullptr instead of 0 or NULL 2023-05-20 15:41:36 +01:00
m-holger e28f4efb00 Replace deprecated C++ includes 2023-05-20 15:41:25 +01:00
m-holger b7791566f6 Add new data member QPDFWriter::Members::root_og
Also, uninitialize QPDFWriter::Members members.
2023-03-17 11:19:48 +00:00
Jay Berkenbilt c99a1ecd4f Update copyright to 2023 2023-02-25 14:18:13 -05:00
m-holger d16308b3f5 Tune QPDFWriter::writeString etc methods
Use string_view parameters and call pipeline write methods directly.
2023-01-23 07:00:58 -05:00
m-holger aefb8ff9ef Refactor QPDFWriter::writePad 2023-01-08 13:33:10 -05:00
m-holger 8363657cf3 Change QPDFWriter::object_queue to std::vector 2023-01-08 13:33:10 -05:00
m-holger 008364a9a4 Remove redundant friend class statements 2022-12-04 14:05:16 -05:00
Jay Berkenbilt 9a9a7ab097 Comment about qpdf/PointerHolder.hh in public headers 2022-09-23 15:15:39 -04:00
Jay Berkenbilt d780954bb3 Add some missing QPDF_DLL markers
These markers are being added for nested classes that are already
marked with QPDF_DLL_CLASS. They don't make any different on Linux,
but they matter on Windows.
2022-09-12 13:19:07 -04:00
Jay Berkenbilt 3a7ee7e938 Move C-based ProgressReporter helper into QPDFWriter 2022-06-19 08:46:58 -04:00
Jay Berkenbilt 8ccd3a8a89 Mark weak encryption with API changes (fixes #576) 2022-04-30 17:24:15 -04:00
Jay Berkenbilt 2213ed0c3d Remove deprecated (pre-8.4.0) encryption APIs 2022-04-30 17:23:58 -04:00
Jay Berkenbilt cdd0b4fb7d Use = default and = delete where possible in classes 2022-04-16 11:39:14 -04:00
Jay Berkenbilt a68703b07e Replace PointerHolder with std::shared_ptr in library sources only
(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-09 17:33:29 -04:00
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00
Jay Berkenbilt f91b21c7d4 Preserve input PDF version on pages/split-pages (fixes #610) 2022-02-08 12:34:14 -05:00
Jay Berkenbilt cb769c62e5 WHITESPACE ONLY -- expand tabs in source code
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-08 11:51:15 -05:00
Jay Berkenbilt cfaae47dc6 Add getBufferSharedPointer() to Pl_Buffer and QPDFWriter 2022-02-07 12:53:28 -05:00
Jay Berkenbilt cfaa2de804 Update copyright for 2022 2022-02-04 16:36:22 -05:00
Jay Berkenbilt abc300f05c Replace containers of PointerHolder with containers of std::shared_ptr
None of these are in the public API.
2022-02-04 13:12:37 -05:00
Jay Berkenbilt 750aca5b94 First increment of improving handling of weak crypto (fixes #358) 2021-11-11 12:24:15 -05:00
Jay Berkenbilt bf8fd41fee Update copyright to 2021 2021-01-04 16:26:58 -05:00
Jay Berkenbilt 09027344b9 Refactor: separate code that determines whether to filter a stream 2020-12-28 12:58:19 -05:00
Jay Berkenbilt e5cc065598 Update copyright to 2020 2020-01-26 16:57:27 -05:00
Masamichi Hosoda 5a842792b6 Parse Contents in signature dictionary without encryption
Various PDF digital signing tools do not encrypt /Contents value in
signature dictionary. Adobe Acrobat Reader DC can handle a PDF with
the /Contents value not encrypted.

Write Contents in signature dictionary without encryption

Tests ensure that string /Contents are not handled specially when not
found in sig dicts.
2019-10-22 16:20:21 -04:00
Masamichi Hosoda 50b329ee9f Add QPDFWriter::getWrittenXRefTable() 2019-10-22 16:16:16 -04:00
Masamichi Hosoda 5cf4090aee Add QPDFWriter::getRenumberedObjGen() 2019-10-22 16:16:16 -04:00
Masamichi Hosoda 5e0ba12687 Fix /Contents value representation in a signature dictionary
Table 8.93 "Entries in a signature dictionary" in PDF 1.5 reference
describes that the value of Contents entry is a hexadecimal string
representation when ByteRange is specified.

This commit makes QPDF always uses hexadecimal strings representation
instead of literal strings for it.
2019-10-22 16:16:16 -04:00
Jay Berkenbilt ba5fb69164 Make popping pipeline stack safer
Use destructors to pop the pipeline stack, and ensure that code that
pops the stack is actually popping the intended thing.
2019-08-27 22:27:47 -04:00
Jay Berkenbilt 2794bfb1a6 Add flags to control zlib compression level (fixes #113) 2019-08-23 20:34:21 -04:00
Jay Berkenbilt 658b5bb3be QPDFWriter: clean up overloaded functions
In a small number of cases, it makes sense to replace an overloaded
function with a function that takes a default argument. We can do this
now because we've already broken binary compatibility since the last
release.
2019-06-22 10:13:27 -04:00
Jay Berkenbilt 864a546af6 Build with -fvisibility=hidden when supported 2019-06-21 22:29:31 -04:00
Jay Berkenbilt d71f05ca07 Fix sign and conversion warnings (major)
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-06-21 13:17:21 -04:00
Marco Scarpetta b405e5e1c9 Fix typo (#334) 2019-06-12 14:21:33 -04:00
Jay Berkenbilt e1271361c5 Add documentation for features since 8.3.0 2019-01-19 15:58:51 -05:00
Jay Berkenbilt 6ec22f117d Modernize encryption API for more granularity
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.
2019-01-17 11:43:56 -05:00