Jay Berkenbilt
56f1b411fe
Back out fluent QPDFObjectHandle methods. Keep the andGet methods.
...
I decided these were confusing and inconsistent with how JSON works.
They muddle the API rather than improving it.
2022-05-20 09:16:25 -04:00
Jay Berkenbilt
21d6e3231f
Make use of the new Pipeline methods in some places
2022-05-03 18:31:23 -04:00
Jay Berkenbilt
59f3e09edf
Make Pipeline::write take an unsigned char const* (API change)
2022-05-03 18:31:22 -04:00
Jay Berkenbilt
4f24617e1e
Code clean up: use range-style for loops wherever possible
...
Where not possible, use "auto" to get the iterator type.
Editorial note: I have avoid this change for a long time because of
not wanting to make gratuitous changes to version history, which can
obscure when certain changes were made, but with having recently
touched every single file to apply automatic code formatting and with
making several broad changes to the API, I decided it was time to take
the plunge and get rid of the older (pre-C++11) verbose iterator
syntax. The new code is just easier to read and understand, and in
many cases, it will be more effecient as fewer temporary copies are
being made.
m-holger, if you're reading, you can see that I've finally come
around. :-)
2022-04-30 13:27:18 -04:00
Jay Berkenbilt
7f023701dd
Formatting: remove space in range-style for loops
...
Change .clang-format and commit automated changes from a fresh run of
format-code
2022-04-30 13:26:43 -04:00
Jay Berkenbilt
ab9d557cb0
Use fluent replaceKey
2022-04-29 20:39:54 -04:00
Jay Berkenbilt
cdd0b4fb7d
Use = default and = delete where possible in classes
2022-04-16 11:39:14 -04:00
Jay Berkenbilt
ba0ef7a124
Replace PointerHolder with std::shared_ptr in the rest of the code
...
Increase to POINTERHOLDER_TRANSITION=3
patrepl s/PointerHolder/std::shared_ptr/g **/*.cc **/*.hh
patrepl s/make_pointer_holder/std::make_shared/g **/*.cc
patrepl s/make_array_pointer_holder/QUtil::make_shared_array/g **/*.cc
patrepl s,qpdf/std::shared_ptr,qpdf/PointerHolder, **/*.cc **/*.hh
git restore include/qpdf/PointerHolder.hh
git restore libtests/pointer_holder.cc
cleanpatch
./format-code
2022-04-09 17:33:29 -04:00
Jay Berkenbilt
77e889495f
Update some code manually to get better formatting results
...
Add comments to force line breaks, parenthesize function arguments
that are contatenated strings, etc. -- these kinds of changes improve
clang-format's results and also cause emacs cc-mode to match
clang-format. After this type of change, most of the time, when
clang-format and emacs disagree, clang-format is better.
2022-04-05 14:56:19 -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
820a3f04fd
Remove "lt-" workarounds
...
The executables that libtool built invoked the underlying binary with
an "lt-" prefix. The code contained numerous workarounds for testing,
which can now be removed.
2022-03-18 19:53:18 -04:00
Jay Berkenbilt
70d0d0889b
Remove old build files
2022-03-18 19:53:18 -04:00
Jay Berkenbilt
b8aff90997
Add cmake configuration files
2022-03-18 19:53:18 -04:00
Jay Berkenbilt
a734af681b
Run qpdf from path rather than environment variable in tests
...
With cmake, we are customizing the path for each test suite so we can
ensure we get the right qpdf without having to use an environment
variable.
2022-03-18 19:53:18 -04:00
m-holger
78aa3b6c2b
Tidy example pdf-double-page-size
...
Also fix typo in pdf-attach-file example.
2022-03-03 06:54:30 -05:00
m-holger
1253d1be60
Tidy pdf-create example
...
Convert loop to use range-based for statement.
Remove unnecessary variables.
2022-02-26 12:46:13 -05:00
m-holger
33e8195c3a
Tidy pdf-count-strings example
...
Convert loop to use range-based for statement.
Remove unnecessary variables.
2022-02-26 12:46:13 -05:00
m-holger
527810e939
Tidy pdf-attach-file example
2022-02-25 11:23:43 -05:00
m-holger
5b0030ff59
Tidy pdf-bookmarks example
...
Convert loops to use range-based for statements.
Simplify the extract_bookmarks function.
2022-02-11 09:27:39 -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
c62e8e2b28
Update for clean compile with POINTERHOLDER_TRANSITION=2
2022-02-07 17:38:22 -05:00
m-holger
3e98fe46a2
Tidy example CLI usage
...
Change "-" to "--" for named parameters.
Remove spaces inside "[ option ]" for optional parameters.
Fix "pdf-mod-info --dump file" to match usage message.
2022-02-07 12:49:24 -05:00
Jay Berkenbilt
7fb22740e1
Add operator ""_qpdf for creating QPDFObjectHandle literals
2022-02-05 11:29:25 -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
m-holger
e813176bc0
Fix some doc typos
2022-02-02 14:07:32 -06:00
Jay Berkenbilt
42bff9f458
QPDFJob: let initializeFromArgv just take argv, not argc
...
Let argv be a null-terminated array. There is already code that
assumes this, and it makes it easier to construct the arguments.
2022-02-01 13:50:58 -05:00
Jay Berkenbilt
a0d9d9923c
Finish QPDFJob examples and add tests for them
2022-02-01 13:50:58 -05:00
Jay Berkenbilt
cc5485dac1
QPDFJob: documentation
2022-02-01 09:04:55 -05:00
Jay Berkenbilt
8a9100f674
QPDFJob: add checkConfiguration to Config
2022-01-31 15:57:45 -05:00
Jay Berkenbilt
ce740d987f
Placeholder QPDFJob example
2022-01-30 13:11:03 -05:00
m-holger
07db3200cb
Remove some if statements and simplify some boolean expressions
...
Use QPDFObjectHandle::isNameAndEquals, isDictionaryOfType and
isStreamOfType.
2022-01-27 07:31:12 -06:00
Fredrik Fornwall
e0775238b8
Fix QPDFEFStreamObjectHelper::{get,set}Subtype
...
The /Subtype entry that specifies the mime type of an embedded file is
inside the embedded file stream dictionary directly, not it in the
parameter dictionary.
See Table 45 and 46 in the PDF 1.7 specification:
https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#page=112
2021-09-10 10:02:24 -04:00
Jay Berkenbilt
cb6e53136f
QPDFAcroFormDocumentHelper: add missing analyze calls
2021-03-04 18:11:44 -05:00
Jay Berkenbilt
9fb174b9e9
Major rework of handling form fields when copying pages ( fixes #509 )
2021-03-04 15:08:37 -05:00
Jay Berkenbilt
3bdefb4c2d
Update examples to use copyStream()
2021-02-25 13:21:23 -05:00
Jay Berkenbilt
8fc453b724
Remove accidentally-committed file and fix test that created it
2021-02-23 10:38:05 -05:00
Jay Berkenbilt
f02aa74bf5
Update pdf-overlay-page example to copy annotations
2021-02-22 18:42:06 -05:00
Jay Berkenbilt
7b3cbacf5d
Change from QPDF{Array,Dict}Items to aitems() and ditems()
2021-02-22 11:05:39 -05:00
Jay Berkenbilt
0a52e60ece
Use QUtil::path_basename
2021-02-18 09:59:03 -05:00
Jay Berkenbilt
f21e4f264a
Add file attachment example
2021-02-18 09:59:03 -05:00
Jay Berkenbilt
07f40bd254
QUtil::double_to_string: trim trailing zeroes with option to disable
2021-02-13 02:30:00 -05:00
Jay Berkenbilt
1f4771cd0d
Minor clean up of Windows headers
2021-02-10 07:36:18 -05:00
Jay Berkenbilt
bfbeec5497
Make newly created name/number trees indirect objects
2021-02-08 06:49:56 -05:00
Jay Berkenbilt
4ae93a73c5
Improve memory safety of dict/array iterators
2021-01-31 07:16:03 -05:00
Jay Berkenbilt
1fec40454e
Add example of name/number trees and dictionary/array iteration
2021-01-30 15:52:16 -05:00
Jay Berkenbilt
ce19ec5c4b
Update examples to use QPDFObjectHandle iterators
2021-01-30 15:15:24 -05:00
Jay Berkenbilt
04edfe9fad
QPDFObjectHandle::newUnicodeString to uses UTF-16 only when needed
...
Use the first of ASCII, PDFDocEncoding, or UTF-16 that is capable of
encoding the string.
2021-01-24 03:27:28 -05:00
Jay Berkenbilt
18340b8835
Spell check
2021-01-04 16:26:58 -05:00
Jay Berkenbilt
3be58f49e5
Make more QPDFPageObjectHelper methods work with form XObject
2021-01-02 14:08:53 -05:00
Jay Berkenbilt
6154221edb
QPDFPageObjectHelper: filterPageContents -> filterContents + form XObject
2021-01-02 11:33:36 -05:00