当前位置: 首页 > news >正文

【前端】ikun-pptx编辑器前瞻问题三: pptx的图片如何提取,并在前端渲染。

文章目录

    • pptx中的图片提取的一般步骤
    • rel 映射关系例子
    • 图片在幻灯片中的引用形式
    • pptx树状目录展示

pptx中的图片提取的一般步骤

以第一页幻灯片为例,需要下列步骤:

  1. 在slide1.xml中找到图片ID
  2. 在 slide1.xml.rels 中找到第一页幻灯片的所有映射关系(rid -> 文件)
  3. 整理出映射集合 map<rid: 文件路径>。
  4. 根据id读取文件流, 转换为base64编码
  5. 在<img标签中通过base64渲染出图片。

可以看出这个步骤其实挺复杂了,cursor已经乱写代码导致图片提取不正确, 所以自己慢慢修正吧。

rel 映射关系例子

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout" Target="../slideLayouts/slideLayout1.xml"/>
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image3.png"/>
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image4.png"/>
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="../media/image2.png"/>
</Relationships>

图片在幻灯片中的引用形式

在这里插入图片描述

pptx树状目录展示

在这里插入图片描述


文章转载自:
http://largeish .ciuzn.cn
http://bazooka .ciuzn.cn
http://antibaryon .ciuzn.cn
http://kickshaw .ciuzn.cn
http://bachelorship .ciuzn.cn
http://superuser .ciuzn.cn
http://indicatory .ciuzn.cn
http://cancerroot .ciuzn.cn
http://outline .ciuzn.cn
http://repossess .ciuzn.cn
http://velvety .ciuzn.cn
http://hubby .ciuzn.cn
http://amethystine .ciuzn.cn
http://phytane .ciuzn.cn
http://unchastity .ciuzn.cn
http://comfily .ciuzn.cn
http://remedially .ciuzn.cn
http://malleus .ciuzn.cn
http://plenism .ciuzn.cn
http://invisible .ciuzn.cn
http://chalet .ciuzn.cn
http://disallowance .ciuzn.cn
http://otherwise .ciuzn.cn
http://outlandish .ciuzn.cn
http://quap .ciuzn.cn
http://vassalage .ciuzn.cn
http://galop .ciuzn.cn
http://hmis .ciuzn.cn
http://loricate .ciuzn.cn
http://ethanamide .ciuzn.cn
http://www.dtcms.com/a/293710.html

相关文章:

  • 【LeetCode 热题 100】78. 子集——(解法三)位运算
  • (46)elasticsearch-华为云CCE无状态负载部署
  • Vite 6 到 Vite 7 的迁移指南,常见问题和解决方案
  • Linux驱动-中断-工作队列传参
  • mysql中varchar可以放多少个中文字符?
  • shiro的SecurityUtils.getSubject() 使用说明
  • 【按下电源键后,电脑里发生了什么?——BIOS:启动世界的“第一把钥匙”】
  • AI产品经理面试宝典第49天:智能客服、教育产品与医疗应用设计题相关解析
  • 深入解析Sqoop数据导入的并行切分机制与主键分区算法
  • AM1.5G AAA稳态太阳光模拟器特点
  • 西安电子科技大学金融学431考研经历分享
  • VSCode 开发 STM32 - clangd 带来的极致补全体验
  • FastAdmin 中生成插件
  • Python笔记之跨文件实例化、跨文件调用、导入库
  • 算法竞赛备赛——【图论】拓扑排序
  • PAT 甲级题目讲解:1002《A+B for Polynomials》
  • 二分查找----2.搜索二维矩阵
  • (13)机器学习小白入门YOLOv:YOLOv8-cls中用TensorBoard实时监控指标
  • 深入浅出理解 Reactor:响应式编程的利器​
  • Github上传文件流程图
  • Docker 应用数据备份、迁移方案
  • Redis原理之分布式锁
  • 武德物业和浑元科技-《软件方法》第2章业务建模之愿景03
  • Oracle物化视图详解
  • 计算机网络第四章(4)——网络层《无分类编址CIDR、路由聚合》
  • ESP32-CAM实战:DIY基于OpenAI的AI视觉识别相机
  • 校园后勤服务平台小程序的设计与实现
  • Android埋点实现方案深度分析
  • 新手向:Idea的使用技巧
  • Android 架构演进:从 MVC 到 MVVM 的设计之道