Is it possible to convert *.doc to *.rtf in a java program?

Hi :-)
My challenge is to develop a web-app in ADF Faces. Now i verify some technologies to store mailmerge letters in an easy way. The user of my web-app should upload a MS Word mailmerge document and a csv data source file. My web-app must thereupon convert this two files to a pdf per csv-row and store it to a ftp.
I have build a demo using the open office API. But now i want to try the same by using apache POI and FOP. I can merge the doc files with POI and i can create PDF with FOP.
My problem is, that POI cant convert to a rtf file and FOP uses an rtf file to create a pdf. I dont know, if its possible to convert a doc file to a rtf file. If its possible, is there an API, which will help me out?
Regards
Majo
btw...I am not sure, if its the right forum for my question :-/

HeHe, no sorry. The binary file is the same, because Windows bind doc and rtf with MS Word, it opens the file, which you have renamed to *.rtf in MS Word. But as a doc document, not as a rtf file ;-)
And i dont want to open the rtf file in MS Word. I want to process the rtf file in java.
Thanks
Majo

Similar Messages

  • Is it possible to convert .doc to pdf  ?

    Hi..
    I am very new to Livecycle Workflow...! I just want to know whether it is possible to convert .doc to pdf  ?
    Just by googling i came to know that CreatePDF2 Service will do this Conversion ! But it throws me an Exception like "Conversion Exception :" Cannot connect to Adobe Service "...!
    Can u guys pls help me out to slove the problem ?
    Thanks & Regards
    Karthik.

    you don't know the format of a word doc? well, that's good for you because it's a nightmare.
    - check POI (http://jakarta.apache.org/poi/index.html) to see if you can load-up the .doc then generate the .pdf with iText
    - personally i use the Open Office Bean to open the .doc, i save it in .sxw (OO format which is a jar of different XML files), then i use XSLT to transform content.xml in .fo then use FOP to build the PDF. sounds crazy but works fine (only on a machine with graphic support - not via Telnet, etc...)

  • Convert doc to rtf or doc to html

    Is there any approach to convert the doc files to html or rtf format? The appache poi just provides the read facilities not the converting facilities.
    It's not the problem to convert from rtf to html using XSL transformation.
    But what about doc to rtf. Probably there already written solutions using poi or smth. else?

    Two projects that spring to mind are Apache POI and Apache FOP.
    POI:
    http://jakarta.apache.org/poi/index.html
    FOP:
    http://xmlgraphics.apache.org/fop/
    Either way, you are in for some tough development if you want to do this using Java, and you might want to consider switch to a more suitable platform such as .NET. Word documents are highly microsoft specific so you will want to use a microsoft platform to work with them for the least amount of headaches and risks.

  • Converting .doc or .rtf to xsl-fo

    Hello everyone,
    Can anyone please help me to convert a .doc or .rtf file to xsl-fo using Java API?
    Thank you,
    Rajan S

    Put this in form field on first cell of table:
    <?attribute@incontext:end-indent;'0.0pt'?>
    <?attribute@incontext:start-indent;'0.0pt'?>
    <?attribute@incontext:padding-start;'0.0pt'?>
    <?attribute@incontext:padding-end;'0.0pt'?>
    Regards,
    Gareth

  • 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
    Gayatri

    Hello 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 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 Osho

    You can convert any DisplayObject to byeArray using this function ImageSnapshot.captureBitmapData().getPixels()

  • Its possible to convert Apple script to Java script

    Hi,
    Please Help me anyone to do that script.
    its possible to convert below mentioned Apple script to Java Script.
    Thanks in advance.
    Help me......!
    -yajiv
    Code:
    tell me to addImageLabels()
    on addImageLabels()
              tell application "Adobe InDesign CS5"
                        set numberAdded to 0
                activate
                        set enable redraw of script preferences to true
                        set currentFonts to (get name of every font)
                        if currentFonts does not contain fontname then
                                  display dialog "The font \"" & fontname & "\" is not active on your system." buttons {"Continue anyway", "Cancel"} default button 2
                        end if
                        tell document 1
      -- get a list of unique page IDs in this document
                                  set allpageids to my getPageIds()
                                  repeat with p from 1 to (length of allpageids)
                                            set pgid to item p of allpageids
      -- loop through these, getting a list of unique page item IDs to inspect
                                            tell page id pgid
                                                      set pageitems to (get id of every page item)
                                                      repeat with i from 1 to (length of pageitems)
                                                                set pid to item i of pageitems
                                                                tell page item id pid
                                                                          try
      -- certain boxes will fail to yield a content type, whatever
                                                                                    if content type is graphic type then
                                                                                              set c to class
                                                                                              set i to id
      -- get the name of the link, i.e. the filename, subject to labelFormat (full name, first six chars, etc.)
                                                                                              set gn to my getImageName(pgid, c, i)
                                                                                              if (gn is not "Empty") and (gn is not "") then
                                                                                                         set b to visible bounds
                                                                                                         set h to (item 3 of b) - (item 1 of b)
                                                                                                         set newtop to (item 1 of b) + (h / 2)
                                                                                                         set item 1 of b to newtop
                                                                                                         set w to (item 4 of b) - (item 2 of b)
                                                                                                         if w < minwidth then
                                                                                                                   set item 4 of b to ((item 4 of b) + 0.2)
                                                                                                                   set item 2 of b to ((item 2 of b) - 0.2)
                                                                                                         end if
                                                                                                         set l to (make new text frame at beginning of page id pgid with properties {visible bounds:b, fill color:fillcolor, contents:gn, label:"imagelabel"})
                                                                                                         tell l
                                                                                                                   tell paragraph 1
                                                                                                                             set justification to center align
                                                                                                                             try
                                                                                                                                       set applied font to fontname
                                                                                                                             end try
                                                                                                                             set point size to fontsize
                                                                                                                             set fill color to textcolor
                                                                                                                   end tell
                                                                                                                   set inset spacing of text frame preferences to ((insetspacing as string) & " in") as string
      fit given frame to content
                                                                                                                   set numberAdded to numberAdded + 1
                                                                                                         end tell
                                                                                              end if
                                                                                    end if
                                                                          end try
                                                                end tell
                                                      end repeat
                                            end tell
                                  end repeat -- allpageids
                        end tell -- document 1
      display dialog "Added " & numberAdded & " labels." buttons {okButton} default button 1 giving up after 10 with title scriptName
              end tell -- InDesign
    end addImageLabels
    on getPageIds()
              tell application "Adobe InDesign CS5"
                        tell document 1
                                  tell master spread 1
                                            set masterpageids to (get id of every page)
                                  end tell
                                  set docpageids to (get id of every page)
                        end tell
              end tell
              return masterpageids & docpageids
    end getPageIds
    on getImageName(int1, cla1, int2)
              tell application "Adobe InDesign CS5"
                        tell document 1
                                  tell page id int1
                                            if cla1 is rectangle then
                                                      set imagename to (name of item link of graphic 1 of rectangle id int2)
                                            else if cla1 is polygon then
                                                      set imagename to (name of item link of graphic 1 of polygon id int2)
                                            else
                                                      return "Unknown"
                                            end if
                                            try
                                                      if (labelformat is "First six characters") then
                                                                return (characters 1 thru 6 of imagename) as string
                                                      else if (labelformat is "Base name of linked file") then
                                                                set op to offset of "." in imagename
                                                                return (characters 1 thru (op - 1)) of imagename as string
                                                      else
                                                                return imagename
                                                      end if
                                            on error
                                                      return "Empty"
                                            end try
                                  end tell
                        end tell
              end tell
    end getImageName

    Yajiv:
    I realize English is probably not your first language, but you are not really making sense. Perhaps you could use more words and write in more detail.
    It seems you already have your script in AppleScript. Why do you need to convert it to JavaScript?
    It's going to be inconvenient at best and probably not worth anyone's time.
    Just use the AppleScript.

  • Convert SmartForm to RTF/DOC

    Hello,
    I am wondering if it is possible to convert a smartform to RTF or Doc. I can convert to PDF just fine, but i need it in RTF or DOC
    Thanks.
    Regards,
    Leandro Fonseca

    Thanks for the reply.
    But still, i am not able to get the smartform in ITF format, only OTF, any help?
    So for I have only seen solutions to create PDF documents, and this, I already can do. I need to create a RTF or DOC file, in order for the smarform be editable with text after it is downloaded.
    Regards,
    Leandro Fonseca
    Edited by: Leandro Fonseca on Sep 15, 2008 6:46 PM

  • 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
    only1Vinay

    MS-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.

  • Makes a hash converting to .doc or .rtf

    what's the point in exporting to .doc or .rtf if there is no
    fidelity to buzzword original?

    Thanks for the posting!
    In answer to your question, the point of exporting to .doc or
    .rtf is so you can move your content from one system (Buzzword) to
    another (e.g., Word, OpenOffice.org, or Pages). When moving a
    document from one system to another, one can’t expect page
    fidelity, as each product uses a different layout engine.
    If page fidelity is important, you should export to Adobe
    PDF, as that is the only way to guarantee it. Of course, the
    resultant PDF will not be editable.
    I hope this answers your question.

  • Is it possible to convert an app from 12c to 11g?

    I am using both 11.1.2.4 and 12.1.2.0.
    If I have an app built with 12.1.2.0, which does not include any 12c specific features, is it possible to convert it to 11.1.2.4?
    I am asking because I have a Development environment that is 12c, but a Production environment that is 11g and I am not sure we will be able to upgrade the Production environment
    Thanks in advance..

    It's possible but not an easy task. As 12c uses newer stuff you have to test everything with great care. You might find some things you have to rebuild add they won't work in 11.1.2.4.0 (e.g. components which are only available in 12c. If you read the what's new doc for 12c and you find something you have used, prepare to rebuild this part.
    First thing to try ids to open the project in 11.1.2.4.0 and see if you can compile and run the app.
    Timo

  • Error in converting *.doc to *.pdf

    Running winXP home sp2, adobe pro 7.1.0
    This problem has started suddenly.
    When converting *.doc to *.pdf a window titled AcroDist.exe-Application Error comes up:
    "0x00441ae2" referenced memory at "0x0218ebbc". The memory could not be "read".
    Acrobat stops and can only be stopped from the Task Manager. Try to print something in *.pdf -- same thing happens.
    Anyone, any suggestions? I would be thankful.
    joeZy

    Gloria Mc,
    This occurs with all .doc, Excel, .rtf, .txt (even when trying to print .pdf from a txt software like notepad. It does not occur with picture format files like .jpg or .tiff. I also can combine .pdf files.
    As far as JR's question, if I generate a .prn file and drop it in AcroDist (Distiller), it tries to open Distiller and the same error message comes up.
    All other functions of AA7 seem to work, only when trying to convert document files to .pdf is there a problem.
    If I try to bring up Distiller by itself (no file), the same error occurs.
    I'm still willing to try any suggestions. Thanks for your interest.
    joeZy

  • Error in converting doc to pdf file

    I have a doc file - 53100kB word 2007, 180 pages with text and images. When converting to pdf with AdobePdf, it breaks after 99 pages. I got a message MicrosoftOfficeWord encountred a problem and has to close. Don't have the error report (my mistake)
    Try converting from 102 to last page, it breaks after 28 pages, in log file i have the message:
    %%{ProductName: Distiller }%%
    %%{Page: 1}%%
    %%{Page: 28}%%
    %%{ Error: typecheck: offendingCommand: not }%%
    Stack:
    /Encoding
    /Encoding
    -dict-
    What to do next to make a continuous conversion?
    Thank you.

    Gloria Mc,
    This occurs with all .doc, Excel, .rtf, .txt (even when trying to print .pdf from a txt software like notepad. It does not occur with picture format files like .jpg or .tiff. I also can combine .pdf files.
    As far as JR's question, if I generate a .prn file and drop it in AcroDist (Distiller), it tries to open Distiller and the same error message comes up.
    All other functions of AA7 seem to work, only when trying to convert document files to .pdf is there a problem.
    If I try to bring up Distiller by itself (no file), the same error occurs.
    I'm still willing to try any suggestions. Thanks for your interest.
    joeZy

  • Inbound Refinery and WebCenter Content link not convert doc into PDF

    hi
    I like to have possibility to convert uploaded document over web center space to PDF
    in order to have that I installed UCM and IBR and linked them
    when I upload doc in web space I see that document is shown in WC Content and it have been sent it to IBR but when I go to IBR Conversion history I get the following
    Step PDFExport forced conversion failure by conversion engine because of error: Unable to start process 'CmdLineConversion_1_exsimple'. for every document file and for every image file I get
    Step CreateNativeThumbnailWithImageExport forced conversion to be incomplete with error: Unable to start process 'CmdLineConversion_205_exsimple'.
    HELP ?!?
    Laslo

    You may want to post this question in the WebCenter Content forum instead of WebCenter - Interaction, which is a completely different product.

  • Adobe acrobat java sdk is available? if yes then its  possible to convert pdf to word

    adobe acrobat java sdk is available ?  if yes then its  possible to convert pdf to word(doc)

    There is little interest in automating Acrobat with Java, since it cannot be run on a server. On a client workstation, OLE is available, and perhaps Java can use that.
    (JavaScript is of course another story).

Maybe you are looking for