Control image size in output PDF?
See original GitHub issueContext:
- version: 5.0.1
- platform: macOS
- node version: v17.3.1
I have a markdown file like this
# Foo
Blah blah
![img|200](images/something.png)
In the above scenario, something.png is 1000x1000px (example). I am trying to control its size to 200px wide.
When I output this using md-to-pdf
, the image is full size. Is there any workaround or other syntax I can use?
Thank you 🙏
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to resize a PDF image
On the top toolbar, click Tools > Edit PDF > Edit. · Hover your cursor over the image you want to edit. ·...
Read more >5.4 Control the size of plots/images | R Markdown Cookbook
5.4 Control the size of plots/images. The size of plots made in R can be controlled by the chunk option fig.width and fig.height...
Read more >How to control output image size · Issue #93
Sometimes when i converted a pdf file to images, each image is more than 20MB. How can i reduce the size of the...
Read more >How to set size for local image using knitr for markdown?
For pdf output, you will have to specify units for the figure dimensions, e.g. out.width='100pt' , otherwise latex will throw an error about...
Read more >Adjust Image Sizes
While the % unit was supported in older versions of HTML, it was removed starting in HTML 5. If you need to specify...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, didn’t realize the renderer was extensible with JS. 🤯 I guess I should have read the docs more closely. Thanks for the tip, much appreciated!
Marked only supports a couple of markdown flavors and neither of them have any shorthand syntax for adding a width to an image, sorry.
That being said, it’s relatively simple to extend marked, and overwrite the image renderer so that you can use some custom syntax (see https://marked.js.org/using_pro#renderer).
Disclaimer: this has not been tested so might need some adjustments but I hope you get the idea.