slidev icon indicating copy to clipboard operation
slidev copied to clipboard

Warn Safari users that PDF export won't work as intended

Open gy-mate opened this issue 11 months ago • 3 comments

Is your feature request related to a problem? Please describe.

When exporting to PDF in Safari...

  • there are no Margin options, you can only select paper sizes
  • the exported PDF's margins are too large: Image
  • the blur in a global-bottom.vue like this is not applied to the exported PDF, making it look ugly: Image

Environment

  • Slidev version: 51.0.1 (local)
  • Browser: Safari 18.2
  • OS: macOS 15.2

Describe the solution you'd like

A warning shown to Safari users that these features won't work in their browser. Or—even better—if possible, a fix for these issues.

Describe alternatives you've considered

These work in Chrome so I had to use it for exporting. The CLI could also be used.

gy-mate avatar Jan 18 '25 19:01 gy-mate

There has been some warning for non-Chrome users:

https://github.com/kermanx/slidev/blob/d40ae7852b2305ad0ac8b3ff0c12438f30c782ac/packages/client/logic/screenshot.ts#L60-L61

https://github.com/kermanx/slidev/blob/d40ae7852b2305ad0ac8b3ff0c12438f30c782ac/packages/client/pages/export.vue#L256-L261

I am not sure if it shows up as expected or not - I don't have a Safari to test 🥹

kermanx avatar Feb 21 '25 13:02 kermanx

There has been some warning for non-Chrome users:

https://github.com/kermanx/slidev/blob/d40ae7852b2305ad0ac8b3ff0c12438f30c782ac/packages/client/logic/screenshot.ts#L60-L61

https://github.com/kermanx/slidev/blob/d40ae7852b2305ad0ac8b3ff0c12438f30c782ac/packages/client/pages/export.vue#L256-L261

@kermanx Yeah but this warning is shown above / for .pptx and PNG exports, not PDF ones:

Image

gy-mate avatar Feb 21 '25 14:02 gy-mate

My bad. For PDF exporting, I think it is possible to somehow support it in Safari (unlike image exporting which requires APIs that Safari doesn't currently provide).

kermanx avatar Feb 21 '25 14:02 kermanx