|
Yes it is and a nice guide for it Link[^]
Good luck
|
|
|
|
|
Hi,
I tried the code given to send mails using lotus notes. I want to try the code for multiple reciepients. I tried the solution given i.e using ";" to separate the email ids. But its not working. Its not working even for cc and bcc.
|
|
|
|
|
Ask the guy who implemented it Link[^]
Good luck
|
|
|
|
|
I want to create a PDF file having the inputs specified at console through Java. I do not want to use ready made libraries like iText etc.
I dont have to create sophisticated PDF's, i just want to write strings in the PDF.
I started off :
import java.io.*;
public class FileHandling
{
public static void main(String args[]) throws IOException
{
FileOutputStream fos=new FileOutputStream("file.pdf");
DataOutputStream dos=new DataOutputStream(fos);
DataInputStream dis=new DataInputStream(System.in);
String str;
System.out.println("enter string value");
str=dis.readLine();
dos.writeChars(str);
dos.close();
fos.close();
}}
But this is not working, i guess i am missing the specifications of the PDF. Please provide me solution for it, and a code would be highly obliged
|
|
|
|
|
I don't know why you don't like Itext[^]? Anyway there is no simple way to do it unless you want to implement it your self. A nice article to read here in codeproject utilizes PDF Generation using XSLFO and FOP[^] but if I where you I would stick to Itext a simple example:
import java.awt.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.io.*;
import java.util.zip.*;
public class TextToPDF{
public static void main(String arg[]){
try{
InputStreamReader in= new InputStreamReader(System.in);
BufferedReader bin= new BufferedReader(in);
System.out.println("Enter text:");
String text=bin.readLine();
Document document = new Document(PageSize.A4, 36, 72, 108, 180);
PdfWriter.getInstance(document,new FileOutputStream("pdfFile.pdf"));
document.open();
document.add(new Paragraph(text));
System.out.println("Text is inserted into pdf file");
document.close();
}catch(Exception e){}
}
}
18 lines of code what do you think? Better than 16+ don't you think?
Regards
|
|
|
|
|
akashj87 wrote: FileOutputStream fos=new FileOutputStream("file.pdf");
You need to understand that this does not create a PDF file. The extension of "pdf" means nothing to Java or to Windows/UNIX, it is merely a convention for humans to recognise the type of file, but the application still has to do the work to create the file.
The definition of DataOutputStream.writeChars() states that it Writes a string to the underlying output stream as a sequence of characters . The structure of a PDF file is much more complex than this (see the specifications on the Adobe web site). The easiest way to achieve your objective is use the tools that are available.
|
|
|
|
|
you can use Apache FOP without having to learn XSL-FO or complex API. Just put the data you want convert in a XML file and use this XSL FO generator to create the PDF file.
|
|
|
|
|
Hi Everybody !
I 've got some question about TTS:
1.Currently are there any Java Opensource can read German,French,...
2.Are there any free database Dictionary that we can download
(I prefered with English-Vietnamese,German-Vietnamese).
Thanks and regards !
|
|
|
|
|
eSpeak[^]
To use it in a Java application just call the Runtime.getRuntime.exec("command"); where command is what you want to hear. Example command might be cmd.exe /C %path of espeak%\\espeak "This is a test"
Good luck
|
|
|
|
|
Hi Member!
I've got the c++ source from the link you gave.
But when i compile(Using BorlandC), the compiler couldn't find two file:
getopt.h
speak_lib.h
i try to found these file in source, there no file name identical those.
How can i compile this code and which tool diffrent from BorlandC,...
I don't want to use the setup_espeak.exe because i just want to embed the exe file into my java app and the relative resource. So user needn't to setup this file.
Thanks regards!
modified on Wednesday, September 30, 2009 10:48 PM
|
|
|
|
|
Hi Everybody !
I found Jespeak.
I set the build path to the jespeak-0.2-alpha.jar
but when run the program, i got this Error:
JeSpeak Copyright (C) 2007 pjer at users dot sourceforge dot net
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JeSpeak in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.jespeak.JeSpeakNative.<clinit>(JeSpeakNative.java:25)
at com.jespeak.JeSpeakImpl.<init>(JeSpeakImpl.java:26)
at com.jespeak.JeSpeak.getInstance(JeSpeak.java:53)
at com.jespeak.JeSpeak.main(JeSpeak.java:125)
How can i fix this.
Thanks and regards !
modified on Wednesday, September 30, 2009 11:56 PM
|
|
|
|
|
Jespeak is not fully implemented yet thats why I referd you to espeak. Correct me if I am wrong but cant you include the espeak file in your application and call it from there by Runtime.getRuntime().exec("C:\\eSpeak\\command_line\\espeak.exe \"This is a test\""); ?
|
|
|
|
|
Hi member !
I knew the command to execute the espeak with the agruments.
(By the way, i want to ask you about the command you gave,
1.which language espeak will speak?
2.If i want espeak speack read german or french, with command argument for the language?
)
But i download the setup_espeak.exe, so if i want to use the espeak.exe i must install it.
So, i want the espeak.exe stard alone to embed into my app that the users who will use my app needn't install setup_espeak.exe.
You can read this link for more info:
http://espeak.sourceforge.net/commands.html[^]
# speak is a stand-alone version which includes its own copy of the speech engine.
Where can i download it.
Thanks and regards
modified on Thursday, October 1, 2009 5:01 AM
|
|
|
|
|
1. English
2. You need to follow the steps mentioned in the mbrola.html which is available under docs.
3. Yes only you need to install it then copy the espeak file to your Java project folder after you done step 2. There you can call the exe from Java and when you want to deploy include the file with Jar thats it.
Good luck
|
|
|
|
|
|
I need to create a method that reads in bytes until it reaches a nullterminator using FileInputStream. Can someone point me in the right direction?
|
|
|
|
|
jonig19 wrote: I need to create a method that reads in bytes until it reaches a nullterminator using FileInputStream. Can someone point me in the right direction?
You could try this[^]!
|
|
|
|
|
|
I m developing a module in which i have catch the data(Hindi data (Unicode) in beans from the user and submit it to the Action. In corresponding action data(in Hindi)has to be stored in MS Access database and has to be retrieved back from Database.
I make simple
1. i have to submit Hindi(Unicode format) news in MS Access database through the web page developed using (JAVA,STRUTS)
2. i have to display these news on the JSP/Struts-Action pages.
I tried
String sFieldName=new String(bean.getFieldName().getBytes,"UTF-8"));
and
String sFieldName=new String(bean.getFieldName().getBytes,"ISO-8859-1"));
and
String sFieldName=new String(bean.getFieldName().getBytes,"utf-8"));
and
String sFieldName=new String(bean.getFieldName().getBytes,"iso-8859-1"));
but i did not get success.
can somebody help me
|
|
|
|
|
|
This is a long shot, but does anyone know how to set the ShrinkToFit property for an Excel Cell or CellStyle and apply it in POI?
|
|
|
|
|
|
Thanks. I'd actually got thar far recently after hours of searching through namespaces/classes... what I can't figure out is how to apply the ExtendedFormatRecord to an existing CellStyle.
|
|
|
|
|
Hi David, Nevermind the first solution you can use the Java Excel API [^]
import java.io.*;
import jxl.*;
import jxl.write.*;
public class ShrinkToFitExample
{
public static void main(String[] args) throws Exception
{
WritableWorkbook workbook = Workbook.createWorkbook(new File("output.xls"));
WritableSheet sheet = workbook.createSheet("First Sheet", 0);
WritableCellFormat arial10format = new WritableCellFormat();
arial10format.setShrinkToFit(true);
Label label2 = new Label(1,0, "demo Text", arial10format);
sheet.addCell(label2);
workbook.write();
workbook.close();
}
}
|
|
|
|
|
Unfortunately, I have to use POI - I'm actually not using Java but C#.
I'm using NPOI which is a port of the Java POI to .NET. I asked here because it is a direct port of the Java solution so should work identically (assuming there isn't a bug or ommision in the port). NPOI isn't widely used yet so there's no one to ask in the C# world!
Thanks for the time and trouble you've gone to anyway
|
|
|
|