aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pdf-overlay-page.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-05-27 19:19:52 +0200
committerm-holger <m-holger@kubitscheck.org>2023-06-02 17:00:40 +0200
commit3c5700c255f4603b5df9c6d183d13dd71a083cc3 (patch)
tree0f01c62c54b56d009b341922fa3441907a2e560b /examples/pdf-overlay-page.cc
parent6e6a73d28f5f61f038209a61a3e85995dc71aa32 (diff)
downloadqpdf-3c5700c255f4603b5df9c6d183d13dd71a083cc3.tar.zst
Code tidy - reflow comments and strings
Diffstat (limited to 'examples/pdf-overlay-page.cc')
-rw-r--r--examples/pdf-overlay-page.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/examples/pdf-overlay-page.cc b/examples/pdf-overlay-page.cc
index 6d1cd0b0..75577094 100644
--- a/examples/pdf-overlay-page.cc
+++ b/examples/pdf-overlay-page.cc
@@ -6,10 +6,9 @@
#include <cstdlib>
#include <iostream>
-// This program demonstrates use of form XObjects to overlay a page
-// from one file onto all pages of another file. The qpdf program's
-// --overlay and --underlay options provide a more general version of
-// this capability.
+// This program demonstrates use of form XObjects to overlay a page from one file onto all pages of
+// another file. The qpdf program's --overlay and --underlay options provide a more general version
+// of this capability.
static char const* whoami = nullptr;
@@ -44,24 +43,21 @@ stamp_page(char const* infile, char const* stampfile, char const* outfile)
int min_suffix = 1;
std::string name = resources.getUniqueResourceName("/Fx", min_suffix);
- // Generate content to place the form XObject centered within
- // destination page's trim box.
+ // Generate content to place the form XObject centered within destination page's trim box.
QPDFMatrix m;
std::string content =
ph.placeFormXObject(stamp_fo, name, ph.getTrimBox().getArrayAsRectangle(), m);
if (!content.empty()) {
- // Append the content to the page's content. Surround the
- // original content with q...Q to the new content from the
- // page's original content.
+ // Append the content to the page's content. Surround the original content with q...Q to
+ // the new content from the page's original content.
resources.mergeResources("<< /XObject << >> >>"_qpdf);
resources.getKey("/XObject").replaceKey(name, stamp_fo);
ph.addPageContents(inpdf.newStream("q\n"), true);
ph.addPageContents(inpdf.newStream("\nQ\n" + content), false);
}
- // Copy the annotations and form fields from the original page
- // to the new page. For more efficiency when copying multiple
- // pages, we can create a QPDFAcroFormDocumentHelper and pass
- // it in. See comments in QPDFPageObjectHelper.hh for details.
+ // Copy the annotations and form fields from the original page to the new page. For more
+ // efficiency when copying multiple pages, we can create a QPDFAcroFormDocumentHelper and
+ // pass it in. See comments in QPDFPageObjectHelper.hh for details.
ph.copyAnnotations(stamp_page_1, m);
}