Word.ImageFormat enum
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/insert-and-get-pictures.yaml
// Gets the first image in the document.
await Word.run(async (context) => {
const firstPicture = 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);
});
字段
bmp = "Bmp" | |
emf = "Emf" | |
exif = "Exif" | |
gif = "Gif" | |
icon = "Icon" | |
jpeg = "Jpeg" | |
pdf = "Pdf" | |
pict = "Pict" | |
png = "Png" | |
svg = "Svg" | |
tiff = "Tiff" | |
undefined = "Undefined" | |
unsupported = "Unsupported" | |
wmf = "Wmf" |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈