diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-09-26 20:29:26 +0200 |
---|---|---|
committer | Jay Berkenbilt <jberkenbilt@users.noreply.github.com> | 2022-11-19 20:10:42 +0100 |
commit | f69ed209d093155e9921487056142370d0a6d0ce (patch) | |
tree | 9778601b165d4fde804f56671051423cfbbecab8 /examples/pdf-attach-file.cc | |
parent | 9ebabd19538512b6515696b164a17b90060a75c3 (diff) | |
download | qpdf-f69ed209d093155e9921487056142370d0a6d0ce.tar.zst |
Use QPDF::newStream in examples
Diffstat (limited to 'examples/pdf-attach-file.cc')
-rw-r--r-- | examples/pdf-attach-file.cc | 32 |
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( |