Background
OpenOffice Writer cannot link to an ASCII text source file, apply syntax highlighting, transfer it to a frame, and update the contents of the frame whenever the source file changes. However, OpenOffice Writer can reference images and automatically update images when they change.
Problem
Images must be high resolution (300 dpi or more) with syntax coloring suitable for a white background (i.e. a printed page).
Question
How to create high-quality images automatically from source code files, for example:
- SQL
- PostgreSQL Functions;
- Java
- bash scripts; and
- R and PL / R?
Attempts
Most attempts were a variation on the following topic:
$ enscript --color -f Courier12 -B -1 --highlight=sql -h -o - source.sql |\
convert - -trim -border 10 source.png
There are several problems with this approach:
- (
-resample -density ). - (, ).
Courier100 .png, .-border 10 lightgray.
PostScript - ImageMagick - GIMP, . , , GIMP nil.