Flattens this control to its parent page. In effect, replaces the control with its
BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)
Flattening locks control from editing. Flattening can significantly reduce file
size if RemoveUnusedObjects property is set to true.
This method flattens the control in 2 steps:
Draws control on its parent page using text and vector graphics operators.
Removes control from the document and from the PdfPage.Controls
collection of its parent page.
- Do not use this control after successful flattening. The flattened control is
detached from its document.
This method modifies PdfPage.Controls collection so do not use
Flatten() method within foreach (var control in page.Controls) loop.
- This method can change graphics state of the page. To avoid possible side effects,
call the method right before saving of the document.