I am trying to convert text into an image, with a static layout and size while adjusting the font size based on the amount of text. I prefer using wkhtmltoimage 0.12.5 as it offers various CSS styling options. Currently, I am working on a Mac.
Below is a snippet from my Test.html file:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="flowtype.js"></script>
</head>
<body>
<div>Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test </div>
<script type="text/javascript">
$('body').flowtype();
</script>
</body>
</html>
You can find more information about Flowtype here.
Although this setup works in the browser, it does not render correctly through wkhtmltoimage.
When I use the command line below:
wkhtmltoimage --width 300 --height 100 Test.html Test.png
The text appears too small in the resulting image. Could this be related to the window size?
I have also tried using wkhtmltopdf to create a PDF, but encountered similar issues.
Any suggestions or ideas to resolve this problem?