html - Converting Source ASCII Files to JPEGs -


I publish technical books, prints, PDFs, and Kindle / MOBI on the path with EPUB.

Burning does not support monospace fonts, which are useful for source code listings. The only way to fonts the monospace is to convert text (Java source, HTML, XML, etc.) to JPEG images. More specifically, due to the pagination point, the input ASCII file is required to be divided into slices of each ~ 6 lines, each slice is converted to JPEG, so the listing screen can increase it to a royal There is a pain.

To do this in my current system:

  1. Run expand to set a consistent 2-space tab size,
  2. a2ps , which pipe to ...
  3. A small Pearl snippet for adding %% language: 3 \ n " line , Which pipes to ...
  4. Change the image magic to , (e) to take a PS and make a JPEG, a proper background, 575x148 + 5 + 28 , etc.

which used to work 100% of the time, now it works 95% of the time remaining time, I convert: image in geometry Errors are not there, which can not seem to run away because I do not understand what the problem is.

Before this process, I used a beautiful print engine ( source-highlight ) to get HTML from source code ... but then only one thing I could get it in convert, in JPEG, HTML was to automate screen-grip from an embedded Gecko engine. Reliability stability, which is why I closed my current system.

So, if you were, and you need to automatically change the source list in JPEG images, how would you do it? Bonus points if it offers some kind of beautiful-print process (e.g., bold keyword)!

Or, if you know that is usually converted: Geometry does not contain the image , that might be helpful. My current process is ugly, but if I can return it to 100% reliability, then it's okay.

Thanks in advance!

You can consider html2ps and then convert imagemagick.

One idea: If your goal (burning?) Supports PNG, then use it in priority for JPEG for this text rendering.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -