What else can I try in CSS to get PDF printed page to smaller print size

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

Hi,

I’m afraid I don’t know anything about pdf but you say it works when you don’t include images so have you tried just including one image to see if it immediately breaks? If it doesn’t break with one image then it will be a matter of eliminating/adding images to find out where the problem occurs.

If it does break with one image then it may be something to do with the conversion software I guess.

Thanks. I also communicated with the conversion site programmers who suggested a similar solution with the HTML–take the large HTML file and make it into something smaller. In other words eliminate some of the CSS styles/HTML content to reduce the complexity. All very good suggestions.