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
Similar Messages
-
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. -
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 -
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.
-
Converting .DOC, .XSL filo to PDF
Hi all,
currently I am looking for a Java API which would be able to convert DOC and XSL files to PDF file + adding bookmark information into both files also. I am not interested in solutions using hidden instances of some applications like Jacob (using MS Word instance) or OpenOffice SDK (using OpenOffice.org appl.) as it is the problem I am trying to avoid.
Thanks a lot for any advice.
Frank
P.S.: I am a newie in here so I hope I didn't "do" anything against rules... :)You can not. the best you can do is use something like POI to give an approx. render of the page, and spit it out to PDF, or using a native word view, and script it in some way to print to a PDF.
-
How to convert RTF or XSL-FO template to PDF template
We have a "satisfied" RTF template used in 11.15.9. But it no longer works in 11.5.10.2. We would like to try what metalink note#305307.1 suggested.
Has anyone done template conversion from RTF or XSL-FO to PDF?
Thanks.Hi
You should not have a problem. When you upgraded did you run the post install step?
Step 5 Run XML Publisher Template Re-Generator concurrent program. (Required for Upgrades Only) (System Administrator)
If you are upgrading from an earlier version of XML Publisher, you must run the XML Publisher Template Re-Generator concurrent program. Use Standard Request Submission to submit this request from the XML Publisher Administrator responsibility. The request will prompt you for the following parameter:
Regeneration Criteria
Select "Outdated" to regenerate only outdated templates.
Select "All" to regenerate all templates.
Regards, Tim -
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. -
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() -
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.
joeZyGloria 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 -
I can not open adobe files that end in .doc. I purchased the 19.99 to convert doc to pdf and I still cant open. I get an error reading.
Hi,
Which Adobe Service did you purchased?
If you have purchased CreatePDF please visit: https://createpdf.acrobat.com/SignIn.html
Sign in with your Adobe ID and password, and then convert your word doc into PDF.
Please let me know if that works.
If you have Adobe Reader, you cannot convert .doc file to .PDF by drag and drop.
~ Aditya -
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()
-
Poor quality when "shortcut" converting DOC - PDF Windows 7
Hi,
The products involved arr Adobe acrobat X Standard, Word 2010 and Windows 7.
We have a problem with converting DOC to PDF. If we use the right click shortcut on a DOC file the quality gets all messed up but if we open it in Word and then choose print with Adobe PDF printer the quality gets the expected Distiller printer option (High quality).
//KimI had seen this conflicting settings, but only now dug deeper to verify; this make no sense, from a development or usage situation.
From the PDF Printer properties,
The General tab has a Printing Perferences sub menu - I typically set my preference from that route.
The Advanced tab has a Printing Defaults sub menu with a dialog identicle to the Preferences dialog, but the Default setting may be other than that used in the Printing Preferences...
Change your setting in Advanced > Printing Defaults -
How to save to .doc or .rtf without loosing formatting
Hi, I have to submit academic assignments with either .doc or .rtf file extensions. However, in the University there is a protocol for headers and footers so that the assignment is anonymous and when quoting from reference documents we have to indent paragraphs. When writing this is pages and exporting to .doc or .rtf all of the formatting gets lost. If I submit these without the right formatting, I will get marked down. They will not accept .pdf, which works OK - how can I save in .doc or .rtf without loosing the formatting?
Hi Peter Breis, you have suggested soemthing that works which is the first line and left paragraph indents but this still does not work with tabs. The .rtf is not a solution becaue of the need for headers and footers (with pages numbers). In the .rtf file they just appear at the end of the text rather than a header and footer.
Anyway, in summary, thank you Peter, you have given me a solution that works which is to indent using first line and left paragraph indents and to export into a .doc document. The headers and footers export without a problem using this method. I will nominate all the extra marks that I will get from following the University's protocol to you!, Thanks! -
Retriving .doc and .rtf files in soap attachments
Please help me
I'm using JAXM to retrive soap attachments
When i retrive txt files (.txt) it retrivs the content of the document
without any problem but when i try to retrive .doc or rtf
it gives content as
java.io.FileInputStream@587c94
(retrive attached files which are recived from client)
how do i get the content from word or rtf document
this is the way i tried to get the content
while (it.hasNext()) {
AttachmentPart ap = (AttachmentPart)it.next();
contentType = ap.getContentType();
content =(String)ap.getContent();
p.println("content---->"+content);//wrriting to text file
System.out.println("*** attachment content: " + content);
thanks namsHere is the code I used to send and receive a PDF file as a SOAP attachment. Note that if the sender uses a DataHandler for the attachment's content, there's no need to set the MIME type explicitly because the DataHandler does it for you.
* Sender
// create the data source and data handler
DataSource source = new FileDataSource("form.pdf");
DataHandler handler = new DataHandler(source);
// create attachment for message
AttachmentPart attachment = message.createAttachmentPart(handler);
// set content id (optional)
attachment.setContentId("enrollment_form");
// add attachment to message
message.addAttachmentPart(attachment);
// send message
providerConnection.send(message);
* Recipient
public class Receiver extends JAXMServlet implements OnewayListener {
public void onMessage(SOAPMessage message) {
// get attachment
Iterator it = message.getAttachments();
AttachmentPart attachment = (AttachmentPart) it.next();
if (attachment.getContentType().equals("application/pdf")) {
// read contents into byte buffer
ByteArrayInputStream contentStream =
(ByteArrayInputStream)attachment.getContent();
// use standard Java I/O methods to save in file
int bytesToRead = contentStream.available();
byte[] buffer = new byte[bytesToRead];
contentStream.read(buffer);
// write buffer to new file
FileOutputStream file = new FileOutputStream("form.pdf");
file.write(buffer);
file.close();
log("Attachment " + attachment.getContentId() + " with type "
+ attachment.getContentType() + " written to form.pdf");
else {
log("attachment content has MIME type " + attachment.getContentType()
+ ", Java type " + attachment.getContent().getClass());
}
Maybe you are looking for
-
Hi All, I have a cube in which i'm using the TIME DIM that i created in the warehouse. But now i wanted a new measure in the cube which is Average over time and when i wanted to created the new measure i got a message that no time dim was defined, so
-
10.6.8 update: screen brightness issues when hooked to external monitor
I just upgraded to MacOS 10.6.8 yesterday, and since then, the screen on my Macbook is acting strange. I'm hooked up to an external monitor which I use almost all the time as the primary monitor. Usually, when I'm using the external, I turn the bri
-
Serial # W87*****Z67 OS 10.7.4 is my late 2007 MacBook Pro (black) but when attempting to purchase X Mountain Lion upgrade I get message that hardware is not supported. But X Mountain Lion tech spec says mid to late 2007 Macbook pros supported. Any t
-
I pre order Christina Aguilera Bionic CD when i had my computer. I no longer have my computer but I do however have wi-fi in my house. Is there any way I can just get the CD to download straight to my Ipod without the computer via wifi or will i need
-
Extending a 2007 Draft 'N' and 2011 Final 'N'?
Hello, What I need to achieve; Get an internet connection to my 2008 Mac Pro 3,1 (no wireless card installed, no access to phone lines or network cables - just power). What I have; NetGear DG834GSP ADSL2+ Wireless (G+B) router and 2007 Airport Extre