首页 > 解决方案 > 使用 Google Docs API v1 的 insertInlineImage(),我可以将对象大小设置为实际图像大小的百分比吗?

问题描述

Google Docs V1 API 有insertInlineImage端点。该端点采用以下结构:

{
  'insertInlineImage': {
    'location': {
      'index': 1215
    },
    'uri': url,
    'objectSize': {
      'height': {
        'magnitude': 500,
        'unit': 'PT'
      },
      'width': {
        'magnitude': 500,
        'unit': 'PT'
      }
    }
  }
}

有没有办法让我将单位类型更改为原始图像大小/尺寸的缩放或百分比因子,而不是使用点?IE 我希望图像大小为 50%。

更新: 链接到实际文档:https ://developers.google.com/docs/api/how-tos/images#python

标签: pythongoogle-docs-api

解决方案


推荐阅读