aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDF.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-29 03:53:55 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-29 03:53:55 +0100
commit2d0885bc119af035ab2df4d8c19000408223ae7f (patch)
tree2801e45bcfbd58f42472c4b2212f828032e38992 /include/qpdf/QPDF.hh
parent2712869cf96916bceeac7def35b6d0a54bd10316 (diff)
downloadqpdf-2d0885bc119af035ab2df4d8c19000408223ae7f.tar.zst
Clarify documentation for copyForeignObject regarding pages
Make explicit that copyForeignObject can be used on page objects and will copy them properly but not update the pages tree.
Diffstat (limited to 'include/qpdf/QPDF.hh')
-rw-r--r--include/qpdf/QPDF.hh23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index cfb10aac..329c2756 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -301,12 +301,18 @@ class QPDF
//
// The return value of this method is an indirect reference to the
// copied object in this file. This method is intended to be used
- // to copy non-page objects and will not copy page objects. To
- // copy page objects, pass the foreign page object directly to
- // addPage (or addPageAt). If you copy objects that contain
- // references to pages, you should copy the pages first using
- // addPage(At). Otherwise references to the pages that have not
- // been copied will be replaced with nulls.
+ // to copy non-page objects. To copy page objects, pass the
+ // foreign page object directly to addPage (or addPageAt). If you
+ // copy objects that contain references to pages, you should copy
+ // the pages first using addPage(At). Otherwise references to the
+ // pages that have not been copied will be replaced with nulls. It
+ // is possible to use copyForeignObject on page objects if you are
+ // not going to use them as pages. Doing so copies the object
+ // normally but does not update the page structure. For example,
+ // it is a valid use case to use copyForeignObject for a page that
+ // you are going to turn into a form XObject, though you can also
+ // use QPDFPageObjectHelper::getFormXObjectForPage for that
+ // purpose.
// When copying objects with this method, object structure will be
// preserved, so all indirectly referenced indirect objects will
@@ -930,9 +936,10 @@ class QPDF
QPDFObjectHandle& stream_dict, bool is_attachment_stream,
std::vector<PointerHolder<Pipeline> >& heap);
- // Methods to support object copying
+ // Unused copyForeignObject -- remove at next ABI change
QPDFObjectHandle copyForeignObject(
- QPDFObjectHandle foreign, bool allow_page);
+ QPDFObjectHandle foreign, bool unused);
+ // Methods to support object copying
void reserveObjects(QPDFObjectHandle foreign, ObjCopier& obj_copier,
bool top);
QPDFObjectHandle replaceForeignIndirectObjects(