diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-01-12 15:14:20 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-01-12 16:01:47 +0100 |
commit | 654c0e8caf5e75119534de5d93d1ee28bd13325a (patch) | |
tree | 7411c6b4af43de86fc0aa977deb29657806c6b48 /include | |
parent | 53d8e916b75b983c18d4611e91d6e74cb51a49ec (diff) | |
download | qpdf-654c0e8caf5e75119534de5d93d1ee28bd13325a.tar.zst |
Allow adding the same page more than once in --pages (fixes #272)
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDF.hh | 10 | ||||
-rw-r--r-- | include/qpdf/QPDFPageObjectHelper.hh | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 8a79b6a3..ef0f0eb7 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -203,6 +203,16 @@ class QPDF QPDF_DLL std::vector<QPDFExc> getWarnings(); + // Return an application-scoped unique ID for this QPDF object. + // This is not a globally unique ID. It is constructing using a + // timestamp and a random number and is intended to be unique + // among QPDF objects that are created by a single run of an + // application. While it's very likely that these are actually + // globally unique, it is not recommended to use them for + // long-term purposes. + QPDF_DLL + unsigned long long getUniqueId() const; + QPDF_DLL std::string getFilename() const; QPDF_DLL diff --git a/include/qpdf/QPDFPageObjectHelper.hh b/include/qpdf/QPDFPageObjectHelper.hh index 5238fa30..e17453fa 100644 --- a/include/qpdf/QPDFPageObjectHelper.hh +++ b/include/qpdf/QPDFPageObjectHelper.hh @@ -140,6 +140,19 @@ class QPDFPageObjectHelper: public QPDFObjectHelper QPDF_DLL void removeUnreferencedResources(); + // Return a new QPDFPageDocumentHelper that is a duplicate of the + // page. The returned object is an indirect object that is ready + // to be inserted into the same or a different QPDF object using + // any of the addPage methods in QPDFPageDocumentHelper or QPDF. + // Without calling one of those methods, the page will not be + // added anywhere. Thew new page object shares all content streams + // and indirect objet resources with the original page, so if you + // are going to modify the contents or other aspects of the page, + // you will need to handling copying of the component parts + // separately. + QPDF_DLL + QPDFPageObjectHelper shallowCopyPage(); + private: class Members { |