Table of Contents

Method ReplaceDuplicateObjects

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

ReplaceDuplicateObjects()

Replaces duplicate document objects with the first duplicate.

public void ReplaceDuplicateObjects()

Remarks

This method finds all groups of object duplicates and replaces all objects from each group of duplicates with the first item of the group.

This method replaces duplicates of all supported kinds. The kinds are mentioned in PdfDuplicateObjectKinds.

This method gives good results for documents which were incrementally updated or created by a merge of several documents with the same objects.

To actually reduce output file size, this method requires removal of unused objects afterwards. Please set RemoveUnusedObjects property to true when using this method.

To be able to replace duplicate inline images too, use one of the MoveInlineImagesToResources methods before calling any of the ReplaceDuplicateObjects methods.

We recommend using this method after you added pages to this document from another source. Check the examples in the Merge PDF documents in C# and VB.NET article.

ReplaceDuplicateObjects(PdfDuplicateObjectKinds)

Replaces duplicate document objects with the first duplicate.

public void ReplaceDuplicateObjects(PdfDuplicateObjectKinds objectsToReplace)

Parameters

objectsToReplace PdfDuplicateObjectKinds

Kinds of objects that should be replaced.

Remarks

This method checks objects of the specified kinds. For each specified kind it finds all groups of object duplicates. Then the method replaces all objects from each group of duplicates with the first item of the group.

This method gives good results for documents which were incrementally updated or created by a merge of several documents with the same objects.

To actually reduce output file size, this method requires removal of unused objects afterwards. Please set RemoveUnusedObjects property to true when using this method.

To be able to replace duplicate inline images too, use one of the MoveInlineImagesToResources methods before calling any of the ReplaceDuplicateObjects methods.

We recommend using this method after you added pages to this document from another source. Check the examples in the Merge PDF documents in C# and VB.NET article.