How to programmatically create MS Office .doc or .docx files on a linux server - linux

In the past I've used catdoc for reading .doc files, but now I need to write them.
What is the best way to go about this? I don't need it to be perfect or fully featured.

a quick and dirty way would be, to write your file in HTML and save the file as .doc
Because word can open HTML you would have a Word File^^
Beware that if you open the file with word sometimes the "web-view-mode" is selected

Related

Saving .doc files with MS Word through WebDAV not possible - no PUT request sent

I'm trying to implement a Node.js file server using the webdav-server npm module which works perfectly.
I'm able to open, edit and save .docx files with Microsoft Word (Microsoft® Word 2016 MSO (16.0.14228.20216) 32-Bit). As well as .odt files with LibreOffice Writer (Version: 7.0.6.2 (x64))
Capturing the requests made by Microsoft Word or LibreOffice Writer I detect the expected order GET - LOCK - PUT - UNLOCK representing the requests made by opening a file (GET), deactivating the readonly mode (LOCK), saving some changes (PUT) and closing the text editor application (UNLOCK).
However if I want to edit and save a .doc file with my Mircosoft Word application I see that there is not PUT request when saving the changes and therefore the changes are lost on closing the application. There is no feedback of any kind through MS Word when clicking the save button. Not that it saved the changes nor that it didn't.
On the other hand when I open the .doc files with LibreOffice Writer there is a PUT request as I'd expected it to be.
I also tried to switch the file type in the MS Word settings so it should use .doc to save files instead of .docx (default with MS Word 2016) but that didn't change anything.
Anyone knows what the problem could be? I don't get why the PUT request should not be sent by Microsoft Word for the .doc file type but for the .docx file type?
(It's a requirement of the project that it also works with .doc files, in the best case with LibreOffice and MS Word)
Thank you all in advance!

PolyAnalyst: Is there a way to read in the bookmarks of a PDF file?

I have a PDF with bookmarks. I tried to read it into PolyAnalyst but looks like it completely ignores the bookmarks. Is there a way to make PA keep the bookmarks of the file?
There currently is no method of extracting pdf bookmark metadata. You can, however, extract bookmark metadata from a Microsoft Word file.

Can we print docx file without open with any office dll?

Can I print and PDF docx file without open into winword by VSTO or OOXML from MS-office installed desktop/server? Is any DLL is there to do?
I need to make print and PDF bunch of files.
Yes you can:
there are lot's of libraries. Like:
Free Word API to Operate DocX documents - Convert your docx to pdf and then print it.
Apsose Word: It's some kind of the standard library to work with docx in .Net, but not really cheap.
In addition you can find some similar questions here and here.

How to preview word files through documents portlet like pdf files?

I have added the document portlet and to that a few pdf's and word files.
But when I click on pdf files they generate a preview, and the docx files don't. Why?
I want to preview the docx files also. Is there a method to achieve it?
Liferay makes use of OpenOffice/LibreOffice for deciphering MS-Office documents. You'll have to set up a connection to OpenOffice or LibreOffice (which has to run in server mode) in order to use it the way you want.

mass convert Excel files into tab-delimited text files

Is there a tool to convert a large number of excel files into tab delimted files automatically?
I just through this together, its not pretty but should do what you need. Tested on WindowsXP / Office2007.
download from: http://stembro.byethost17.com/utility_scripts/xl2tab/xl2tab.html
Extract the xl2tab.vbs file to the directory containing the excel files and double-click to run. It will place the converted files into a new directory called "output." The original directory-structure remains intact within the output folder.
I don't think there are any good free tools to do so right now, but you could look into using the Open Office API to write something,
[http://www.oooforum.org/forum/viewtopic.phtml?t=7657&highlight=convert+xls+csv+command+line][1]
Or for a quick and dirty solution, you could record and Open Office Calc macro that would do it, and launch that macro from the command line.
This might also help http://dag.wieers.com/home-made/unoconv/
convert to csv, and maybe replace , with tabs?

Resources