Open hcw70 opened 1 year ago
I think the thing to do is to remove the existing (incomplete) language text generation, and to just create hard-coded "draft", "review" and "final" SVG images. A parameter could then override the default images, so you would be free to use the SVG of your choice.
I've got the same idea for HTML - here - just amend the CSS file to use your preferred image.
You create the images by XSLT anyway, why not have the text, color, size (and rotation) as parameters all together?
Then you dont need to distinguish between draft / review / final in you implementation at all?
The different XSLTs for these modes look similar anyway....
Hard-coded images does not sound like the right idea IMHO, since some (including me) may have different states / text to put as background ("confidential"). Your plugin btw is not called "review states plugin" but "watermark plugin"... 8->
In which case there will be a need to split the existing SVG generation in two.
1 - retrieve the appropriate default texts for the state (if not already supplied by the command line) 2 - better parameterise the SVG generation to allow for custom texts, colors and sizes.
Why not simply forward the command line parameters into
and have only one template to render the SVG?
IMHO you can also remove further code if you dont provide (language dependant) default texts. Simply grab the text to render from the command line.... The one who calls dita to render the doc already knows the language of the docs anyway....
Try pulling the latest change. The default is still DRAFT DOCUMENT
./dita -f pdf -i ../document.ditamap --pdf.watermark.color=blue
./dita -f pdf -i ../document.ditamap --pdf.watermark.color=blue --pdf.watermark.text1=confidential
./dita -f pdf -i ..//document.ditamap --pdf.watermark.color=blue --pdf.watermark.text1=CONFIDENTIAL --pdf.watermark.text2="" --pdf.watermark=final
./dita -f pdf -i ..//document.ditamap --pdf.watermark.color=blue --pdf.watermark.text1=CONFIDENTIAL --pdf.watermark.text2="" --pdf.watermark=final --pdf.watermark.fontsize=14
Great! Looks good.
Two things:
Would it be possible to extend this plugin to:
So i would like to call it like
dita -i my.ditamap -o doc/ -f pdf --pdf.watermark=CONFIDENTIAL --pdf.watermark.color="#e0e0e0" --pdf.watermark.size="48"
and get a "CONFIDENTIAL" as a backdrop.