WinDjView自0.5版本就支持了,现在的1.03版本也做得很好。
Linux下似乎只有djvused这个命令行CLI工具才能做到,语法比较简单:
Annotation syntax Annotations are represented by a sequence of annotation expressions. The following annotation expressions are recognized: (background color) Specify the color of the viewer area surrounding the DjVu image. Colors are represented with the X11 hexadecimal syntax #RRGGBB. For instance, #000000 is black and #FFFFFF is white. (zoom zoomvalue) Specify the initial zoom factor of the image. Argument zoomvalue can be one of stretch, one2one, width, page, or composed of the letter d followed by a number in range 1 to 999 representing a zoom factor (such as in d300 or d150 for instance.) (mode modevalue) Specify the initial display mode of the image. Argument modevalue is one of color, bw, fore, or back. (align horzalign vertalign) Specify how the image should be aligned on the viewer surface. By default the image is located in the center. Argument horzalign can be one of left, center, or right. Argument vertalign can be one of top, center, or bottom. (maparea url comment area ...) Define an hyper-link for the specified destination.
Argument url can have one of the following forms: href (url href target)
where href is a string representing the destination and target is a string representing the target frame for the hyper-link, as defined by the HTML anchor tag . The destination string href can be an arbitrary URL or can be composed of the hash character ("#") followed by either a component file identifier or a page number. Page numbers may be prefixed with an optional sign to represent a page displacement. For instance the strings #-1 and #+1 can be used to access the previous page and the next page.
Argument comment is a string that might be displayed by the viewer when the user moves the mouse over the hyper-link.
Argument area defines the shape and the location of the hyperlink. The following forms are recognized: (rect xmin ymin width height) (oval xmin ymin width height) (poly x0 y0 x1 y1 ... ) (text xmin ymin width height) (line x0 y0 x1 y1)
All parameters are numbers representing coordinates. Coordinates are measured in pixels and have their origin at the bottom left corner of the page.
The remaining expressions in the maparea list represent the visual effect associated with the hyper-link.
A first set of options defines how borders are drawn for rect, oval, polygon, or text hyperlink areas. (none) (xor) (border color) (shadow_in [thickness]) (shadow_out [thickness]) (shadow_ein [thickness]) (shadow_eout [thickness])
where parameter color has syntax #RRGGBB as described above, and parameter thickness is an integer in range 1 to 32. The last four border options are only supported for rect hyperlink areas. The default border is a simple black line. Border options do not apply to line areas.
When a border option is specified, the border becomes visible when the user moves the mouse over the hyperlink. The border may be made always visible by using the following option: (border_avis)
The following two options may be used with rect hyperlink areas. The complete area will be highlighted using the specified color at the specified opacity (0-100, default 50). (hilite color) (opacity op)
This is often used with an empty URL for simply emphasizing a specific segment of an image.
The following three options may be used with line areas to specify an optional ending arrow, the line width and color. The default is a black line with width 1 and without arrow. (arrow) (width w) (lineclr color)
Finally the following three options can be used with text areas. The default background color is transparent. The default text color is black. The pushpin option indicates that the text is symbolized by a small pushpin icon. Clicking the icon reveals the text. (backclr bkcolor) (textclr txtcolor) (pushpin)
(metadata ... (key value) ... ) Define meta-data entries. Each entry is identified by a symbol key representing the nature of the meta data entry. The string value represents the value associated with the corresponding key. Two sets of keys are noteworthy: keys borrowed from the BibTex bibliography system, and keys borrowed from the PDF DocInfo metadata. BibTex keys are always expressed in lowercase, such as year, booktitle, editor, author, etc.. DocInfo keys start with an uppercase letter, such as Title, Author, Subject, Creator, Produced, Trapped, CreationDate, and ModDate. The values associated with the last two keys should be dates expressed according to RFC 3339.
|
直接:
set-ant
(maparea "" "Game" (rect xmin ymin width height) (hilite #RRGGBB))
.
save
就可以了。
Linux下似乎只有Djview4能做得跟WinDjView那样方便的显示djvu文件。但是,缺乏的重要功能是:不能加书签bookmark和不能高亮highlight某段文字。
书签的语法是:
Outline/Bookmark syntax The outline syntax is a single list of the form (bookmarks ...)
The first element of the list is symbol bookmarks. The subsequent elements are lists representing the toplevel outline entries. Each outline entry is represented by a list with the following form: (title url ... )
The string title is the title of the outline entry. The destination string url can be an arbitrary URL or can be composed of the hash character ("#") followed by either the component file identifier or the page number corresponding to the outline entry. The remaining expressions describe subentries of this outline entry.
|
也是比较简单。问题是如何方便的组合到鼠标事件中。如何方便用户编辑添加。
C++的代码,没用到啥高级特性,看起来还好。djvused.cpp一个文件就实现很多功能,确实不错。值得好好看看,修改一下,可以给DjvuView4打个patch。
这样,在Linux下看djvu文件,注释,做记录,就不用再羡慕WinDjView的功能了。说实话,Andrew的程序真的做得很贴心。值得参考:-)
阅读(1200) | 评论(0) | 转发(0) |