PdfImage.ReplaceWith Method (Byte[])

Replaces image with the image bytes.

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


public void ReplaceWith(
	byte[] imageBytes
Public Sub ReplaceWith ( 
	imageBytes As Byte()


Type: System.Byte[]
The array of image bytes.


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 array 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