diff --git a/examples/qpdfjob-remove-annotations.cc b/examples/qpdfjob-remove-annotations.cc index 1ebb536..d3f822d 100644 --- a/examples/qpdfjob-remove-annotations.cc +++ b/examples/qpdfjob-remove-annotations.cc @@ -15,15 +15,15 @@ static char const* whoami = nullptr; static void usageExit(std::string const& msg) { - std::cerr << std::endl - << whoami << ": " << msg << std::endl - << std::endl - << "For help:" << std::endl - << " " << whoami << " --help=usage usage information" << std::endl - << " " << whoami << " --help=topic help on a topic" << std::endl - << " " << whoami << " --help=--option help on an option" << std::endl - << " " << whoami << " --help general help and a topic list" << std::endl - << std::endl; + std::cerr << '\n' + << whoami << ": " << msg << '\n' + << '\n' + << "For help:\n" + << " " << whoami << " --help=usage usage information\n" + << " " << whoami << " --help=topic help on a topic\n" + << " " << whoami << " --help=--option help on an option\n" + << " " << whoami << " --help general help and a topic list\n" + << '\n'; exit(QPDFJob::EXIT_ERROR); } @@ -40,13 +40,13 @@ realmain(int argc, char* argv[]) auto qpdf_sp = j.createQPDF(); auto& pdf = *qpdf_sp; for (auto page: pdf.getAllPages()) { - page.replaceKey("/Annots", "null"_qpdf); + page.removeKey("/Annots"); } j.writeQPDF(pdf); } catch (QPDFUsage& e) { usageExit(e.what()); } catch (std::exception& e) { - std::cerr << whoami << ": " << e.what() << std::endl; + std::cerr << whoami << ": " << e.what() << '\n'; return QPDFJob::EXIT_ERROR; } return j.getExitCode();