webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.71k stars 416 forks source link

?print-pdf can't find local images #467

Closed hwang63130 closed 9 months ago

hwang63130 commented 10 months ago

Not sure what's wrong. But here is an example example.md file.

When I trying to print the pdf via http://localhost:1948/example.md/?print-pdf, the image on the first page is correctly displayed while the local image on the second page is shown missing.

# page 1

![img](https://example.site/example-image.png)

---

# page 2

![img](local-image.png)

node version 20.9.0 reveal-md version 5.5.2

vvscode commented 9 months ago

@hwang63130 can you attach some demo repository to check the issue?

hwang63130 commented 9 months ago

@vvscode Here is a very simple example with only 2 slides. The first slide contains an image linking to the reveal.js homepage, while the second pointing to the local page.

https://github.com/hwang63130/reveal-md-example

By running reveal-md presentation.md , images on both slides seem ok under the presentation mode.

But if I visit http://localhost:1948/presentation.md/?print-pdf/, it appears the link to the local image is broken.

vvscode commented 9 months ago

It works fine for me

Screenshot 2023-11-20 at 17 51 19

reveal-md.pdf

reveal-md@5.5.2

hwang63130 commented 9 months ago

@vvscode Thanks for the response. But not sure what went wrong but I still get the same broken link on both of my Windows machines (one with Windows 10 and the other with fresh installed Windows 11/Node LTS/reveal-md). I don't have Linux/Mac machines in hand so I am not sure if it is a Windows-only issue.

image

vvscode commented 9 months ago

Have you inspected the page? Please run build command and attach results here in archive, also what is the directory name for you? Are you using wsl?

hwang63130 commented 9 months ago

OK. I know what I did wrong. I have been using the url http://localhost:1948/presentation.md/?print-pdf instead of http://localhost:1948/presentation.md?print-pdf When switching to the correct url, the local images is shown correctly.

Sorry for the stupid mistake.