PdfImage.ReplaceWith Method (String)

Replaces image with the image in the file.

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)


public void ReplaceWith(
	string imageFile
Public Sub ReplaceWith ( 
	imageFile As String


Type: System.String
The name of the image file.


This method replaces all occurrences of the image within the document. If the original image was used on several pages, then the new image will be used in the same places of the same pages.

The file should contain a complete image encoded with one of the supported image compression schemes. This method won't work with only raster bytes or any other partial contents.

This method throws UnsupportedImageException when used on an inline image. You can check IsInline property before invoking this method.

Replacing an image can cause unexpected and/or unpleasant visual results. For example, image masking effects can be broken if you replace a mask image or an image that has a mask. Usually, it is undesirable to replace an image with a new image that has very different size and/or proportions.

See Also