?
Solved

trouble passing int to java class constructor (itext)

Posted on 2005-02-24
10
Medium Priority
?
259 Views
Last Modified: 2013-12-24
Hi,
  I am trying to pass an int to a java class constructor.  Here's what I am trying to do...
<cfscript>
aTable = CreateObject("java", "com.lowagie.text.pdf.PdfTable").init(javaCast("int",3));
</cfscript>

Heres the error msg....
Unable to find a constructor for class com.lowagie.text.pdf.PdfTable that accepts parameters of type ( java.lang.Integer ).

Any suggestions???

Anyone else using iText and if so, how???

Thanks for any info,
El
0
Comment
Question by:joneset
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
10 Comments
 
LVL 8

Expert Comment

by:kyle1830
ID: 13392811
read this solution.  looks like the same problem you are having

http://tech.badpen.com/index.cfm?mode=entry&entry=18

kyle
0
 
LVL 1

Author Comment

by:joneset
ID: 13393203
Kyle,
   Thanks for the link.  I'd already seen it.  
Problem is, I am dealing with a primative (int), not an array and
I really am not sure how to make that leap from the info in that link.

El
 
0
 
LVL 8

Expert Comment

by:kyle1830
ID: 13397039
Was out for a while.

I just started messing with iText two weeks ago.  I am looking for an alternative to activePDF and have not had a chance to do anything but examples.  I also used the custom tag from this post: http://www.houseoffusion.com/cf_lists/index.cfm?method=messages&threadid=19864&forumid=4#100646

where did you come up with (just trying to follow along, I have not seen this yet.)?
>>aTable = CreateObject("java", "com.lowagie.text.pdf.PdfTable").init(javaCast("int",3));

0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 1

Author Comment

by:joneset
ID: 13404510
Kyle,
   Don't know what happened between yesterday and today, but the cast works today.

Here's a link for an itext example (by Aaron Johnson I think, not sure tho, the link is down today)  ...

http://cephas.net/blog/2004/03/14/using_itext_pdf_coldfusion.html

El
0
 
LVL 8

Expert Comment

by:kyle1830
ID: 13404543
I have tried going there several times also and can never get it.

Do you do anything today from yesterday?  Restart? Pray?  Let me in on your secret.
0
 
LVL 1

Author Comment

by:joneset
ID: 13676003
Hi,
   Although I appreciate kyle's reply, it did not answer the question.
I've posted a message in cleanup area for closing (and delete if
required) this question.
Thanks,
El
0
 
LVL 1

Accepted Solution

by:
joneset earned 0 total points
ID: 13689965

One last comment -

The answer to my original question was that I was not using the correct iText class.  Once I used the right class (PdfPTAble), I was able to use an int in the constructor.

In the end, I 've decided to use my own java code (using the iText package) in my own jar file and
call the classes in the jar from Coldfusion and I have to admit, my PDF's are pretty basic.

Although it was a challenge, I have been successful using iText with Coldfusion.

El
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question