Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Word.ImageFormat enum
- Package:
- word
Represents image format type.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/15-images/insert-and-get-pictures.yaml
// Gets the first image in the document.
await Word.run(async (context) => {
const firstPicture: Word.InlinePicture = context.document.body.inlinePictures.getFirst();
firstPicture.load("width, height, imageFormat");
await context.sync();
console.log(`Image dimensions: ${firstPicture.width} x ${firstPicture.height}`, `Image format: ${firstPicture.imageFormat}`);
// Get the image encoded as Base64.
const base64 = firstPicture.getBase64ImageSrc();
await context.sync();
console.log(base64.value);
});
Fields
| bmp = "Bmp" | Bitmap image format. |
| emf = "Emf" | Enhanced Metafile image format. |
| exif = "Exif" | Exif image format. |
| gif = "Gif" | GIF image format. |
| icon = "Icon" | Icon image format. |
| jpeg = "Jpeg" | JPEG image format. |
| pdf = "Pdf" | PDF image format. |
| pict = "Pict" | PICT image format. |
| png = "Png" | PNG image format. |
| svg = "Svg" | SVG image format. |
| tiff = "Tiff" | TIFF image format. |
| undefined = "Undefined" | Undefined image format. |
| unsupported = "Unsupported" | Unsupported image format. |
| wmf = "Wmf" | Windows Metafile image format. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
