Remove a child page-object from a form-xobject
Source:R/api_completion.R
pdf_form_obj_remove_object.RdWraps FPDFFormObj_RemoveObject + FPDFPageObj_Destroy. The child
must currently belong to the form-xobject. PDFium hands the removed
child back to the caller, so it is destroyed straight away and the
child handle is closed: further calls on it, on the clip paths
read from it with pdf_obj_clip_path() and, when it is itself a
form, on the objects read from it with pdf_form_objects(), error
cleanly. Other handles to the child, from separate
pdf_form_objects() calls, are stale and must not be used; call
pdf_form_objects() again for the remaining children.
Arguments
- form_obj
A
pdfium_objoftype = "form". Parent doc must be readwrite.- child
A
pdfium_objfrompdf_form_objects()(the enumeration of children).
Details
The removal changes the page in memory, so rendering and
pdf_form_objects() reflect it, but PDFium does not write it back
into the form XObject: when the page is saved, the regenerated form
content goes to a /Contents entry that PDF readers ignore, and the
saved file still draws the removed child.