Exported PDFs missing local images in slide body #2433
-
|
Sorry, maybe, it's very nooby question, because I can't find same discussions. I'm making slide with image: ---
layout: full
---
# More in [documentation](https://cli.github.com/manual/gh_api)<MarkerX color="#5d3fd3" title="api" />
<img src="/assets/gh-cli-doc.png" />When I export to pdf, I expected that slide will contain image, same as in web, but slide is empty. I see heading level one, and white space. Buy the way, in this slide: ---
layout: image-right
image: /assets/postgres-repo.png
background-position: left
shadow: true
---
## Postgres DBMS <span class="mono-text">(MIT/BSD)</span><MarkerX color="#0096FF" title="open-source" />
<ul>
<li v-click>Full access to the source code</li>
<li v-click>Use in commercial products</li>
...image in background stay in pdf. I export to pdf with this command: yarn run slidev export --wait 100000 --wait-until load --format pdf --output ../build/pdf/01-lecture.en.pdf 01-lecture.en.mdHere is structure of my dir, from which i run this command: Project structure |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Root causeThis is not a timing issue ( That’s why:
✅ Solution 1 (Recommended): Remove the leading |
Beta Was this translation helpful? Give feedback.
-
Why it still breaks (even with |
Beta Was this translation helpful? Give feedback.
-
|
the issue is that for pdf export you need to use the proper slidev image syntax: option 1: use markdown image option 2: import image in script <script setup>
import ghCliDoc from "/assets/gh-cli-doc.png"
</script>
<template>
<img :src="ghCliDoc" />
</template>option 3: use base64 inline the reason layout images work is because they go through vites asset pipeline. but raw also try adding yarn slidev export --with-clicks --wait 100000 --format pdf ...and check if images are in public folder correctly. sometimes path issue |
Beta Was this translation helpful? Give feedback.
-
|
Guys, I am very grateful for your help. I feel my self very stupid, because I can't resolve this simple problem. Code from my case is open in repo: https://github.com/alchemmist/eosp Here in Thank you a lot, again! 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
Hooray! 🎉 I found the solution. I wrote a custom component
|
Beta Was this translation helpful? Give feedback.
-
|
And one more question for discussion. Guys, what do you think, about this case? Maybe it's not only my problem and I will be able to send a PR with solution of this problem. Maybe it will be custom component and doc page about it or we can find more idiomatic way... What do you think? |
Beta Was this translation helpful? Give feedback.


Hooray! 🎉
I found the solution. I wrote a custom component
Image.vue.Image.vue