Kris, When accessing a static method, all you need to do is do the createObject() call - this gives you access to the class (per se), if you want an actual instance of the object, that would be when you call init().
So in your case it would be: fso = createobject("java","com.lowagie.text.pdf.PdfWriter).getInstance(document, myPDF); As you had originally written. Mark On 8/30/06, Kris Jones <[EMAIL PROTECTED]> wrote: > Calling on all you CF-Java-knowledgeable folks out there. I'm trying > to follow some of the examples in the iText tutorial, and I've hit a > mental wall. > > When trying to instance a file output stream, the java example I see > looks like this: > > Document document = new Document(); > try { > PdfWriter writer = PdfWriter.getInstance(document, new > FileOutputStream("Destinations.pdf")); > [blah blah blah...] > > Obviously, that's not going to fly in a cfscript block. > How would you write this in CF? Something like: > > <cfscript> > document = createobject("java", "com.lowagie.text.Document"); > finalOutPutFile = "C:\testpdf.pdf"; > myPDF = createObject("java","java.io.FileOutputStream").init(finalOutPutFile); > fso= createobject("java","com.lowagie.text.pdf.PdfWriter"); > try { > writer = createobject("java",fso.getInstance(document, myPDF)); > [blah blah blah...] > </cfscript> > > Or would it the actual fso be created like: > fso = > createobject("java","com.lowagie.text.pdf.PdfWriter).getInstance(document, > myPDF); > > What's confusing me is the static PdfWriter.getInstance method. In CF, > I thought I had to call an init() method on the class to get back an > object, but if there's a static method (not a constructor per se), how > would I do this? Forgive this horrid example--I'm sure I've got this > all jumbled around. My ultimate goal is to add destinations and > outlines (bookmarks) to a new PDF file as it gets created via > concatenated PDFs. > > Thanks, > Kris -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251432 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4