summaryrefslogtreecommitdiffstats
path: root/examples/pdf-overlay-page.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-06-17 15:26:16 +0200
committerGitHub <noreply@github.com>2023-06-17 15:26:16 +0200
commit44dce4e2988ec09e36dfb6d1fc527a143e6f597f (patch)
tree3cdb1999faeb5103eb87c36fb1673d8cbb5ab082 /examples/pdf-overlay-page.cc
parentfc30e75122f6bef20ac8d676ac7cb8822feecf3e (diff)
parentacd0acf16931ce92bc908e4960c5a1e43d53b550 (diff)
downloadqpdf-44dce4e2988ec09e36dfb6d1fc527a143e6f597f.tar.zst
Merge pull request #978 from m-holger/reflow
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);
}