Skip to content

New function pdf_underlay_stamp()#33

Open
trevorld wants to merge 1 commit intoropensci:masterfrom
trevorld:underlay-stamp
Open

New function pdf_underlay_stamp()#33
trevorld wants to merge 1 commit intoropensci:masterfrom
trevorld:underlay-stamp

Conversation

@trevorld
Copy link
Contributor

  • New function pdf_underlay_stamp() has same structure as pdf_overlay_stamp().
  • I renamed cpp_pdf_overlay() to cpp_pdf_stamp() and gave it a underlay boolean flag. If true we underlay the stamp, if false we overlay the stamp. The key difference in logic is as follows:
        if (underlay) {
          ph.addPageContents(
            QPDFObjectHandle::newStream(&inpdf, content + "\nq\n"), true);
          ph.addPageContents(
            QPDFObjectHandle::newStream(&inpdf, "\nQ\n"), false);
        } else { // overlay
          ph.addPageContents(
            QPDFObjectHandle::newStream(&inpdf, "q\n"), true);
          ph.addPageContents(
            QPDFObjectHandle::newStream(&inpdf, "\nQ\n" + content), false);
        }

closes #31

@trevorld trevorld changed the title New function pdf_underlay_stamp New function pdf_underlay_stamp() Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: pdf_underlay_stamp()

1 participant