I’m using an online service to convert HTML to PDF sized for viewing on a Kindle. My target line length is 50 characters per line. However, I reach that number only when I don’t include images in the conversion (see #1 below).
You can look at the HTML page I’m working on. Its a chapter from an public domain book (see the pastebin #2 below). The HTML is a basic html page with some complex tables. The images and text are simply in divs in the body.
I’ve made the following changes to the original HTML,
- Added css to the html header:
pre {white-space: pre-wrap;}
img {max-width: 380px;} //I’ve tweaked this last number down to as low as this 200px, see file #3 below; - Changed inline image values from their original px to %
- Deleted the image height property (to maintain proportionality)
As you can see in file #3, I can get full control over the image size with these changes; however, the smaller image only works to shrink the page width up to a point (approx 55-60 cpl). I can only achieve the line length in file #1 when I don’t include images.
What have I missed?
–
Desired line width (without images)
[1]: https://docs.google.com/file/d/0B7q1i4T96t6edklMVFdQb0FpcG8/edit?usp=sharing
Modified HTML
[2]: http://pastebin.com/uNuEabpc
PDF with image max-width = 200px
[3]: https://docs.google.com/file/d/0B7q1i4T96t6eYzRFVVhBWlpHbkk/edit?usp=sharing