Skip to content

Embed PDF images #322

Answered by yhatt
Compizfox asked this question in Q&A
Jun 24, 2022 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Marp is running on Web-based technology unlike TeX based tools. ![]() image syntax is corresponding to <img src=""> HTML tag, and it's only working with images compatible with Web (See Image file type and format guide on MDN).

Generally PDF is not regarded as an image file. There is a MIME type application/pdf in PDF, not image/*. To embed PDF document, use <iframe> tag with enabling HTML rendering by Marp CLI's --html option.

# Embed PDF

<iframe src="file.pdf" width="100%" height="500" frameborder="0" />
marp your-markdown.md --html --pdf --allow-local-files

https://forum.webdeveloper.com/d/146790-how-to-display-pdf-picture-in-html

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@yhatt
Comment options

@Compizfox
Comment options

@YanchunHe
Comment options

@yhatt
Comment options

@YanchunHe
Comment options

Answer selected by Compizfox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants