ImagePlacement Class |
Namespace: Aspose.Pdf
The ImagePlacement type exposes the following members.
Name | Description | |
---|---|---|
![]() | CompositingParameters |
Gets compositing parameters of graphics state active for the image placed to the page.
|
![]() | Image |
Gets related XImage resource object.
|
![]() | Matrix |
Current transformation matrix for this image.
|
![]() | Page |
Gets the page containing the image.
|
![]() | Rectangle |
Gets rectangle of the Image.
|
![]() | Resolution |
Gets resolution of the Image.
|
![]() | Rotation |
Gets rotation angle of the Image.
|
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | Replace |
Replace image in collection with another image.
|
![]() | Save(Stream) |
Saves image with corresponding transformations: scaling, rotation and resolution.
|
![]() | Save(Stream, ImageFormat) |
Saves image with corresponding transformations: scaling, rotation and resolution.
|
![]() | ToString | (Inherited from Object.) |
// Open document Document doc = new Document(@"D:\Tests\input.pdf"); // Create ImagePlacementAbsorber object to perform image placement search ImagePlacementAbsorber abs = new ImagePlacementAbsorber(); // Accept the absorber for first page doc.Pages[1].Accept(abs); // Retrieve images with visible dimensions foreach (ImagePlacement imagePlacement in abs.ImagePlacements) { Bitmap scaledImage; using (MemoryStream imageStream = new MemoryStream()) { // Retrieve image from resources imagePlacement.Image.Save(imageStream, ImageFormat.Png); Bitmap resourceImage = (Bitmap) Bitmap.FromStream(imageStream); // Create new bitmap with actual dimensions scaledImage = new Bitmap(resourceImage, (int)imagePlacement.Rectangle.Width, (int)imagePlacement.Rectangle.Height); } }