How create MS Doc file ?
Hi
I want to create MS Doc file from java, which API I can make use of?
And if there are many, pls let me know which one is better.
Thanks
NKjavaforum wrote:
Hi
I want to create MS Doc file from java, which API I can make use of?
And if there are many, pls let me know which one is better.
ThanksDon't. Create an RTF document with a .doc extension.
How to create a RTF? It depends on what you want to do with it. If have a fixed template that you just want to squish data into then I would spit out an XML file with said data then XSLT to a XSL:FO¹ and use [Apache FOP|http://xmlgraphics.apache.org/fop/].
1) Or skip the XML/XSLT step and spit out XSL:FO.
Similar Messages
-
How to display Doc file format in the JEditPane?
At this time , JEditPane supports RTF and HTML file format ,but
Could anyone tell me how to display DOC file format using JEditPane
or other JTextComponents?
Thx a lot!
CatonHi,
there is no support for doc files (M$ Word?) in Java. You would have to create your own classes for that eventually subclassing JEditorPane, EditorKit, Document etc. As well you'd need your own reader for the doc format.
The problem I see with that however is that there is nothing such as thedoc file format. Microsoft just saves anything produced by MS Word into files ending with .doc. But, if there is anything such as a .doc file format, it changes more often than the weather in April.
Ulrich -
hi
How can i create a doc. file through oracle
Version 11.2.0user588120 wrote:
I just dont ask your permission to create a fileHe wasn't giving you permission. He was telling you that the format of a file you create is not an issue for oracle. In this context "You are free to create .." means "there are no technical reasons not to create ..." -
How to convert Doc file into image
hello frnds
Can any body guide me how to convert doc file into image and show into swf loader.
actually i have to convert doc files into swf files in runtime so that i have to use this flow.
is it possible to convert doc file into byte array and than convert into image.
Thanks And Regards
Vineet OshoYou can convert any DisplayObject to byeArray using this function ImageSnapshot.captureBitmapData().getPixels()
-
How to call DOC file using web.show_documents
Hi friends ,
If I use the built-ins web.show_documents for open the *.doc file
I am getting the following error
ORA-06550: line 5, column 2:
PLS-00201: identifier 'README.DOC' must be declared
ORA-06550: line 5, column 2:
PL/SQL: Statement ignored
DAD name: WebDB
PROCEDURE : readme.doc
URL : http://132.148.160.3:80/WebDB/readme.doc?
PARAMETERS :
===========
ENVIRONMENT:
============
SERVER_PORT=80
SERVER_SOFTWARE=Oracle WebDb Listener 2.1
SERVER_NAME=132.148.160.3
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.0
REMOTE_HOST=132.148.160.251
REMOTE_ADDR=132.148.160.251
REQUEST_METHOD=GET
QUERY_STRING=
SCRIPT_NAME=
PATH_INFO=/WebDB/readme.doc
HTTP_ACCEPT=*/*
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
HTTP_HOST=132.148.160.3
HTTP_CONNECTION=Keep-Alive
Please advice How to call Doc file in web.
Thanx
nullThe syntax to execute web.show_document:
web.show_document('http://server_ip_or_server_name/virtual_path/filename.doc')
The virtual path has been defined in Apache (if you run on web with Apache) or has been defined in Internet Inoformation Server (if you are runing with Internet Information Server.)
null -
How to attach doc file in email
How to attach doc file in email
Hi and Welcome to the Community!
Since you have balance, and the issue is in your Work domain, you need to work with your server admins, as it's possible they are forbidding (via IT Policy) the ability to do as you desire.
Good luck!
Occam's Razor nearly always applies when troubleshooting technology issues!
If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
Join our BBM Channels
BSCF General Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
How to send doc files from one system to another using XI
Hi All,
I have a requirement to pick the word doc files from one file system and send these word document files to ECC system place in ECC application server.Can we achieve this requirement using XI. If so how we can do this. also let me know can we convert these doc files into proxy and send to ECC?. Please let me know. Thanks.
Regards,
RajeshYes You Can
XI Converts Unstructured data(That is non -XML)Type- in your case word doc and maps it to Target structure.
You can either use content conversion
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
You can either built a adaptermodule for the same(U nedd to have Some Java knowledge)
You can also convert without creating any objects in integration directory link for the same is
/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
***********Please Reward Points If find Helpful********* -
How can upload doc file into database !!
Dear Everyone,
How can i upload a doc file into Mysql database ....
can any one please give ur suggestions...
i will show u my code
upload.jsp
<form name="uploader" action="uploaded.jsp"
enctype="multipart/form-data">
<div align="center">
<table id="table1" border="1" bordercolor="#ff0000"
cellpadding="0" cellspacing="0" width="50%">
<tbody bgcolor="#c8d8f8">
<tr>
<td bgcolor="#ccccff">
<p align="center">
Resume Upload! </p>
</td>
</tr>
<tr>
<td>
<p align="center">You can upload your
resume.. </p>
<p align="center">
<table align="center" border="1"
cellpadding="10" cellspacing="10">
<tbody>
<tr>
<td>
<p><input name="file" type="file">
<input name="uploadButton" value="Upload"
type="submit"></p>
</td>
</tr>
</tbody>
</table>
</p>
</td>
</tr>
</tbody>
</table>
</div>
</form>
uploaded.jsp
<BODY>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%
String file1=request.getParameter("file");
int len;
String query;
PreparedStatement pstmt;
int i=0;
Class.forName("com.mysql.jdbc.Driver");
DriverManager.getConnection("jdbc:mysql://localhost:3306 Connection conn= /employee","root","");
try {
File file = new File(file1);
if (file==null)
%>
<center>Nothing in It</center>
<%
else
FileInputStream fis = new FileInputStream(file);
len = (int)file.length();
query = ("insert into loader(resume) VALUES(?)");
pstmt = conn.prepareStatement(query);
pstmt.setString(1,file.getName());
pstmt.setInt(2, len);
//method to insert a stream of bytes
pstmt.setBinaryStream(3, fis, len);
i=pstmt.executeUpdate();
if(pstmt!=null)
pstmt.close();
if(conn!=null)
conn.close();
} catch (Exception e) {
e.printStackTrace();
if(i>0)
out.println("uploaded");
else
out.println("not uploaded")
%>
</BODY>File file = new File("myDoc.doc");
FileInputStream fis = new FileInputStream(file);The file name will most likely NOT be hard-coded. I don't think the question surrounding this topic is how to do the insert statement (he/she clearly knows SQL).
HTTP and the web browser take care of the file transfer, but the server stores the file in a temporary location. The question is, "How do I found out that location?" In PHP (I know that doesn't offer much help to you, but ...), that location is held in a variable called $_FILES. From there you can simply copy the file to a location you specify (probably with a user-specified name under a directory specifically for that user).
I hope this is of some help:
http://www.oop-reserch.com/mime_example_4.html
Good Luck,
C. R. -
How to convert .doc files to .docx in a sharepoint library programmatically.
Is there any possibility to Convert .doc files to .docx in a sharepoint document library.
I have thousands and lakhs of .doc files and I need to automate to convert those .doc files to .docx with an automation script or powershell script or doing it programmatically.
Can someone help me get through this.
Thanks
GayatriHello Gayatri,
You can convert files from doc to docx using following options
Option 1
in bulk using Office File Converter (OFC) and Version Extraction Tool. Please refer below url for reference - http://technet.microsoft.com/en-us/library/cc179019.aspx
Option 2 - PowerShell
please refer url -http://blogs.msdn.com/b/ericwhite/archive/2008/09/19/bulk-convert-doc-to-docx.aspx
Convert DOC to DOCX using PowerShell
I was tasked with taking a large number of .DOC and .RTF files and converting them to .DOCX. The files were then going to be imported into a SharePoint site. So I went out on the web looking for PowerShell scripts to accomplish this. There are plenty to
choose from.
All the examples on the web were the same with some minor modifications. Most of them followed this pattern:
$word = new-object -comobject word.application
$word.Visible = $False
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat],”wdFormatDocumentDefault”);
#Get the files
$folderpath = “c:\doclocation\*”
$fileType = “*doc”
Get-ChildItem -path $folderpath -include $fileType | foreach-object
$opendoc = $word.documents.open($_.FullName)
$savename = ($_.fullname).substring(0,($_.FullName).lastindexOf(“.”))
$opendoc.saveas([ref]“$savename”, [ref]$saveFormat);
$opendoc.close();
#Clean up
$word.quit()
After trying out several I started to convert some test documents. All went well until the files were uploaded to SharePoint. The .RTF files were fine but even though the .DOC fiels were now .DOCX files they did not allow for all the functionality of .DOCX
to be used.
After investigating a little further it turns out that when doing a conversion from .DOC to .DOCX the files are left in compatibility mode. The files are smaller, but they don’t allow for things like coauthors.
So back to the drawing board and the web and I found a way to set compatibility mode off. The problem was that it required more steps including saving and reopening the files. In order to use this method I had to add a compatibility mode object:
$CompatMode = [Enum]::Parse([Microsoft.Office.Interop.Word.WdCompatibilityMode], “wdWord2010″)
And then change the code inside the {} from above to:
$opendoc = $word.documents.open($_.FullName)
$savename = ($_.fullname).substring(0,($_.FullName).lastindexOf(“.”))
$opendoc.saveas([ref]“$savename”, [ref]$saveFormat);
$opendoc.close();
$converteddoc = get-childitem $savename
$opendoc = $word.documents.open($converteddoc.FullName)$opendoc.SetCompatibilityMode($compatMode);
$opendoc.save()
$opendoc.close()
It worked, but I didn’t like it. So back to the web again and this time I stumbled across the real way to do it. Use the Convert method. No one else seems to have used this in any of the examples but it is a much cleaner way to do it then the compatibility
mode setting. So this is how I changed my code and now all the files come in to SharePoint as true .DOCX files.
$word = new-object -comobject word.application
$word.Visible = $False
$saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat],”wdFormatDocumentDefault”);
#Get the files
$folderpath = “c:\doclocation\*”
$fileType = “*doc”
Get-ChildItem -path $folderpath -include $fileType | foreach-object
$opendoc = $word.documents.open($_.FullName)
$savename = ($_.fullname).substring(0,($_.FullName).lastindexOf(“.”))
$word.Convert()
$opendoc.saveas([ref]“$savename”, [ref]$saveFormat);
$opendoc.close();
#Clean up
$word.quit() -
How To convert .doc file to .jpg file
hello friends,
can anyone tell me how can we convert a .doc file to .jpg file wid d help of java???????Hi,
I am working on similar requirement. There is a vb code which does it using Document Image Printer and you can then call that code from java class using native calls. I will let you know if we succeed. In case you find something else post it here. -
How to convert doc files to pdf files
how do I convert a microsoft doc file into pages and then into a pdf to send out to others?
Several ways:
In Word or in Pages, you can Print and choose to "print to PDF" instead of a printer. This applies to all applications that have the ability to print (I think it is all but I don't have all applications to test that assertion against). It will be like a printout, no embedded links will work.
In Pages, you can Export or Share as a PDF. In Word you can Save As a PDF. In this method, embedded links should still work. -
How create key list file in JC-TCK 3.0.4
hi,
I'm setting JC-TCK 3.0.4 with Global Platform compliant JC Implementation.
So, i shoud be create "key list file", refer to TCK 3.0.4 user guide for using GP proxy.
But i can't create "key list file", what has only example explanation.
please anybody answer about create key file or show me the sample key list file.Hi Thomas,
Thanks for sharing this with us, a lot of guys will find this very helpful since there are a lot of issues with Safari 3.0.4
The title of your topic was better when you called How to stopped Safari 3.0.4 crashing
See you on the board ...
Dimaxum -
How to download .doc file from ms sql
Hi guys.,,,!
I have a problem in file uploading and downloading. The problem is i upload my .doc file in ms sql server successfully completed. After that i would like to download the file from the database.can anybody tell that how to download the file from the database.mani_miit wrote:
I have a problem in file uploading and downloading.OK.
The problem is i upload my .doc file in ms sql server successfully completed. Sorry, I don't see a problem here? You said that it is successfully completed. Please elaborate the problem.
After that i would like to download the file from the database.can anybody tell that how to download the file from the database.Just get an inputstream of the file from the database using ResultSet#getBinaryStream() and write it to the output of whatever UI technology you're using. -
How to convert .doc file into .rtf file in Java?
Hello All,
I want to convert doc file into rtf format in java and for the same i am not getting any help so pls suggest some solution for that.
Thanks and Regards
only1VinayMS-Word formats (DOC) are notorious for not being standardized from one version to another, so what ever you get will be version specific. If you must do the conversion, I suggest you do a MS-Script in Word to do it or one of the .Net languages. As stated the Word format from version to version is not standardized.
-
How create a pdf file width jsp?
hi i want to create a pdf file, but i don't know the procedures
can you help me please?
thankstry iText from Lowagie
http://www.lowagie.com/iText/
Babette
Maybe you are looking for
-
Hi, Am getting the below error in my wls console . please help how to resolve this. <Mar 20, 2012 2:44:38 AM PDT> <Warning> <JDBC> <BEA-001129> <Received exception while creating connection for pool "WebCenter-CustomPortalDS": IO Error: The Network A
-
Java.lang.StackOverflowError in AM extension
Hello All, I m trying to extend AM in Oracle HRMS. The extension is successfully migrated into Oracle application 11.5.10 server. But when i m trying to open the respective page, I am getting the below error. Request URI:/OA_HTML/OA.jsp Exception: ja
-
How to Resolve Storage Link Reconnection Problems
I recently installed the WRT610N on a home network and have had major problems getting the Storage Link capability to work. Initially it worked perfectly. Then, every time I logged in to the computer, I had to go into My Computer and try to open th
-
Hi Gurus, I am a beginner in <b>SAP BW</b>, can anyone kindly guide me in creation of <b>process chains (step by step)</b> and if its not of too much trouble give some detailed info on this topic. thanking you in advance. with regards sreedhar
-
Programmatically add multiple scales to graph
On the front panel, I can choose "duplicate scale" "delete scale" to add/remove multiple scales a Graph control. Can I do this programmatically,i.e., use the VI to adjust the number of scales on the graph? The purpose is to have variable number of