Chad Gray wrote:
> This iText stuff has got my interested peeked and I am going trough some of 
> the Java examples on the iText web site.
> 
> What is this line doing?  And how do I rewrite it in CF?
> 
> BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, 
> BaseFont.NOT_EMBEDDED);

to create a java object in coldfusion, you need to instantiate it *AND* 
call a valid constructor.  Coldfusion "fakes" the constructor by 
creating an "init" method that you can call.  When you create the 
object, you *SHOULD* already have access to its constants.. so this 
should work, assuming you knew the classpath for BaseFont.  Which I don't.

<!--- load object --->
<cfset bf = createObject("java","class.path.BaseFont")>
<!--- call constructor --->
<cfset bf.init(bf.HELVETICA, bf.CP1252, bf.NOT_EMBEDDED)>


Rick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:242645
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to