2

I'm using Pandoc to convert my mardown files to html files, html pages which are Github styled using Github.html5 from the Pandoc-goodies repo which is based on this other repo.

I'm extremely pleased to see that ![](./file.pdf) inserts the complete inline pdf in the html file output, however it's more or less at the minimal size, making it impossible to really read the pdf.

How to tell Pandoc to resize this inline pdf ? I've tried the <div> trick but no luck.

Mike656
  • 23
  • 4

2 Answers2

1

Pandoc allows to add attributes to images, which will also work for <embed> elements. The attributes must be given in curly braces. E.g.

 ![](./file.pdf){width=100% height=80%}

The advantage is that this syntax, contrary to raw HTML, will work in many output formats supported by pandoc.

tarleb
  • 2,047
  • 11
  • 21
0

It is not an 'inline' it is 'embed'.

The default size of the embedded object is decided by the browser. If you want to change it, go to the final html, find the line

<p><embed src="./file.pdf" /></p>

change it to something like:

<p><embed src="./file.pdf" width="100%" height="80%"/></p>

Not sure why it is not done already by the pandoc itself.

White Owl
  • 4,511
  • 1
  • 4
  • 15
  • It works, thanks ! However I needed to keep the `![](./file.pdf)` string as I am using an editor which has some builtins features to detect and open `![](some.thing)` links; the editor also did greyed the html part of the `
    ...`, but he's apparently not smart enough to grey the `

    – Mike656 Nov 11 '22 at 17:22