Hi Jones,

i've improved my stuff once more. It's possible now to load modules
outside the main document by specifying it at the DocumentPrinter 
instance using its method loadModule. I've committed it all into CVS.
I've attached an example, explaining the new feature. This example is
also in CVS.

You can call the stuff by simply calling the document printer:

java org.ujac.print.DocumentPrinter -resource-dir=.
-module=test/print/mymodule.xml ./test/print/custom-tag-test.xml
custom-tag-test.pdf

Note that the module is loaded using the resource loader and must be
located somewhere relative to the specified resource directory.

Best Regards,
Christian

On Wed, 2004-01-28 at 01:21, Christian Lauer wrote:
> Hi Jones,
> 
> the custom tag thing is a good idea. I've hacked a bit and got a quick
> solution. The usage isn't exactly the same as in iText, but
> it should cover the main issues. In the example the custom tags are
> defined in the main document, but it's also possible to define 
> them in an extra document, using the <import> tag.
> 
> I've put the code into CVS, check it out, if you like to test it.
> 
> Regarding documentation: I know there's a lot to do, I'll do my best to
> improve it!
> 
> Best regards,
> Christian
> 
> On Tue, 2004-01-27 at 18:12, jones henry wrote:
> > Christian,
> > Is it possible to map the custom tag to UJAC's tag like done in iText? After 
> > reading the tags documentation and the api, it seems that it is like the 
> > Apache-velocity like template language specifically for generating PDF.
> > Thanks,
> > Jones.
> > 
> > _________________________________________________________________
> > High-speed users—be more efficient online with the new MSN Premium Internet 
> > Software. http://join.msn.com/?pgmarket=en-us&page=byoa/prem&ST=1
-- 
Christian Lauer <[EMAIL PROTECTED]>
<?xml version="1.0" encoding="ISO-8859-1"?>

<module>
	<custom-tag alias="a4" tag="document">
		<attribute name="size" value="A4"/>
		<attribute name="margin-left" value="25"/>
		<attribute name="margin-right" value="25"/>
		<attribute name="margin-top" value="25"/>
		<attribute name="margin-bottom" value="25"/>
	</custom-tag>

	<custom-tag alias="funky" tag="phrase">
		<attribute name="rotate" value="75"/>
	</custom-tag>

	<custom-tag alias="r-cell" tag="cell">
		<attribute name="halign" value="right"/>
	</custom-tag>

	<custom-tag alias="hello" tag="paragraph">
		<attribute name="body" value="Hello ${body}"/>
	</custom-tag>

	<custom-tag alias="normal-font" tag="font">
		<attribute name="font-name" value="normal"/>
	</custom-tag>

	<font-def name="header" family="Helvetica" size="12" style="bold"/>
	<font-def name="normal" family="Helvetica" size="12" style="normal"/>
	<font-def name="small" family="Helvetica" style="normal" size="9"/>
</module>
<?xml version="1.0" encoding="ISO-8859-1"?>

<a4>
	<normal-font>
		<hello>Earth.</hello>
		<hello>Mars.</hello>
		<hello>Universe.</hello>
	</normal-font>
</a4>

Reply via email to