gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.84k stars 625 forks source link

[BUG] Prop [hyperlink] doesn't work when open with WPS #1262

Open huange94 opened 1 year ago

huange94 commented 1 year ago

There is a problem with hyperlink use. While I use WPS to open then generated pptx, the hyperlink doesn't work, but it's ok with Office.

I saw an issue similar to this (#1014), but the questioner didn't detailly introduce WPS:

I would appreciate it if this issue could be resolved : D

Steps to Reproduce

slide.addText(
    [
      { text: 'hello, ' },
      { text: 'this is a link', options: { hyperlink: { url: 'https://github.com/gitbrent/pptxgenjs' } } }
    ],
    {
      x: 3,
      y: 3,
      h: 2,
      color: 'f56c6c',
      fill: { color: '0d7cef' }
    }
  )
huange94 commented 1 year ago

I just tried the solution in #1014 , set [action] attribute as [ppaction://hlinkfile] of , and it does work on either WPS or MS Office.

whejwhq commented 2 weeks ago

具体怎么实现,我这样写还是在wps里不能跳转。 image

whejwhq commented 2 weeks ago

How exactly do I accomplish this, I still can't jump around in wps when I write it this way. image

huange94 commented 2 weeks ago

具体怎么实现,我这样写还是在wps里不能跳转。 image

需要修改源码,传参是无效的。修改源码借助patch-package实现,按 #1014 的描述调整一行代码即可,记得锁pptxgenjs版本。 patch文件截图参考: image

huange94 commented 2 weeks ago

@whejwhq 上面的回复可能不会触发推送,单独@下