aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pdf-attach-file.cc
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-09-26 20:29:26 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-11-19 20:10:42 +0100
commitf69ed209d093155e9921487056142370d0a6d0ce (patch)
tree9778601b165d4fde804f56671051423cfbbecab8 /examples/pdf-attach-file.cc
parent9ebabd19538512b6515696b164a17b90060a75c3 (diff)
downloadqpdf-f69ed209d093155e9921487056142370d0a6d0ce.tar.zst
Use QPDF::newStream in examples
Diffstat (limited to 'examples/pdf-attach-file.cc')
-rw-r--r--examples/pdf-attach-file.cc32
1 files changed, 14 insertions, 18 deletions
diff --git a/examples/pdf-attach-file.cc b/examples/pdf-attach-file.cc
index c04f5b9f..9cb55741 100644
--- a/examples/pdf-attach-file.cc
+++ b/examples/pdf-attach-file.cc
@@ -89,15 +89,13 @@ process(
// Create appearance stream for the attachment.
- auto ap = QPDFObjectHandle::newStream(
- &q,
- "0 10 m\n"
- "10 0 l\n"
- "20 10 l\n"
- "10 0 m\n"
- "10 20 l\n"
- "0 0 20 20 re\n"
- "S\n");
+ auto ap = q.newStream("0 10 m\n"
+ "10 0 l\n"
+ "20 10 l\n"
+ "10 0 m\n"
+ "10 20 l\n"
+ "0 0 20 20 re\n"
+ "S\n");
auto apdict = ap.getDict();
// The following four lines demonstrate the use of the qpdf literal syntax
@@ -127,15 +125,13 @@ process(
">>")));
// Generate contents for the page.
- auto contents = QPDFObjectHandle::newStream(
- &q,
- ("q\n"
- "BT\n"
- " 102 700 Td\n"
- " /F1 16 Tf\n"
- " (Here is an attachment.) Tj\n"
- "ET\n"
- "Q\n"));
+ auto contents = q.newStream(("q\n"
+ "BT\n"
+ " 102 700 Td\n"
+ " /F1 16 Tf\n"
+ " (Here is an attachment.) Tj\n"
+ "ET\n"
+ "Q\n"));
// Create the page object.
auto page = QPDFObjectHandle::parse(