diff options
Diffstat (limited to 'examples/pdf-attach-file.cc')
-rw-r--r-- | examples/pdf-attach-file.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/pdf-attach-file.cc b/examples/pdf-attach-file.cc index 0c046000..decc742f 100644 --- a/examples/pdf-attach-file.cc +++ b/examples/pdf-attach-file.cc @@ -36,16 +36,16 @@ static void process(char const* infilename, char const* password, QPDF q; q.processFile(infilename, password); - // Create an indirect object for the built-in Helvetica font. + // Create an indirect object for the built-in Helvetica font. This + // uses the qpdf literal syntax introduced in qpdf 10.6. auto f1 = q.makeIndirectObject( - QPDFObjectHandle::parse( - "<<" - " /Type /Font" - " /Subtype /Type1" - " /Name /F1" - " /BaseFont /Helvetica" - " /Encoding /WinAnsiEncoding" - ">>")); + "<<" + " /Type /Font" + " /Subtype /Type1" + " /Name /F1" + " /BaseFont /Helvetica" + " /Encoding /WinAnsiEncoding" + ">>"_qpdf); // Create a resources dictionary with fonts. This uses the new // parse introduced in qpdf 10.2 that takes a QPDF* and allows @@ -93,7 +93,7 @@ static void process(char const* infilename, char const* password, apdict.replaceKey("/Resources", QPDFObjectHandle::newDictionary()); apdict.replaceKey("/Type", QPDFObjectHandle::newName("/XObject")); apdict.replaceKey("/Subtype", QPDFObjectHandle::newName("/Form")); - apdict.replaceKey("/BBox", QPDFObjectHandle::parse("[ 0 0 20 20 ]")); + apdict.replaceKey("/BBox", "[ 0 0 20 20 ]"_qpdf); auto annot = q.makeIndirectObject( QPDFObjectHandle::parse( &q, |