docx

How to convert xsl-fo to docx (Office Open XML) in Java?

空扰寡人 提交于 2019-12-04 19:39:08
I'm looking for an open-source or commercial friendly library in Java to convert xsl-fo to docx (Office Open XML) format. I'm planing to use xsl-fo to produce pdf documents (with Apache FOP), so I thought generating Word documents ( docx ) out of the same source XML could be a good idea. UPDATE : I forgot to mention that I'm using Java. Alternatively, you could do: your source xml -> docx -> xsl-fo -> pdf. or easier perhaps: source xml -> Flat OPC XML -> xsl-fo -> pdf. Once you have a docx (or a Flat OPC XML document), transforming that to PDF via FOP is easy with docx4j (since you mention FOP

Converting HTML to odt, doc, docx

丶灬走出姿态 提交于 2019-12-04 19:17:21
问题 Is there an easy way to convert HTML(with CSS styles and embedded images) to ODT, DOCX, DOC from the command line on linux server. I searched a lot but have not found a good option. There was a problem the same way to convert to PDF, decided by wkhtmltopdf. Perhaps there are ways to convert the resulting PDF documents to other formats? 回答1: To convert to odt it's pretty easy after installing pandoc. After the relatively hard part: from odt (or even html ) you can script (Open|Libre)Office via

Generating docx file from HTML file using OpenXML

前提是你 提交于 2019-12-04 17:51:16
I'm using this method for generating docx file: public static void CreateDocument(string documentFileName, string text) { using (WordprocessingDocument wordDoc = WordprocessingDocument.Create(documentFileName, WordprocessingDocumentType.Document)) { MainDocumentPart mainPart = wordDoc.AddMainDocumentPart(); string docXml = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?> <w:document xmlns:w=""http://schemas.openxmlformats.org/wordprocessingml/2006/main""> <w:body><w:p><w:r><w:t>#REPLACE#</w:t></w:r></w:p></w:body> </w:document>"; docXml = docXml.Replace("#REPLACE#", text); using

Converting HTML to doc(x) and / or PDF [closed]

十年热恋 提交于 2019-12-04 17:26:04
I have to convert html to the doc(x) and pdf format. I found aspose, but this tool can do a lot of more work than i need, and thats why it isn't really cheap. Are there similar tools, which can just do this conversion ? I need this on a Desktopapplication where no word / office is installed * Just for Info Finally bought asponse words. all other options weren't as good as this tool Assuming that these are essentially “documents” and not fancy graphical web pages (i.e. you'd like them to be legible, but aren't deeply concerned with the minutiæ of web layout formatting), you can use LibreOffice

Converting docx to pdf with pure python (on linux, without libreoffice)

烂漫一生 提交于 2019-12-04 17:23:30
问题 I'm dealing with a problem trying to develop a web-app, part of which converts uploaded docx files to pdf files (after some processing). With python-docx and other methods, I do not require a windows machine with word installed, or even libreoffice on linux, for most of the processing (my web server is pythonanywhere - linux but without libreoffice and without sudo or apt install permissions). But converting to pdf seems to require one of those. From exploring questions here and elsewhere,

Read and replace contents in .docx (Word) file

余生颓废 提交于 2019-12-04 13:19:43
问题 I need to replace content in some word documents based on User input. I am trying to read a template file (e.g. "template.docx"), and replace First name {fname}, Address {address} etc. template.docx: To, The Office, {officeaddress} Sub: Authorization Letter Sir / Madam, I/We hereby authorize to {Ename} whose signature is attested here below, to submit application and collect Residential permit for {name} Kindly allow him to support our International assignee {name} {Ename} Is there a way to

Django create .odt or .docx documents to download

折月煮酒 提交于 2019-12-04 12:46:40
I need to generate either .odt or .docx files based on the information I have in my database. Let's say I have a model: class Contact(models.Model): first_name = models.CharField() last_name = models.CharField() email = models.EmailField() I want that users are able to generate office document that contains that information and also some other text. I took a look for this example which is using python-docx and it gives me an idea how to generate that document. But I can't figure out where this file is saved or is it even created. In my template I have a link: <a href="{{ contact.generate_docx

Why Office OpenXML splits text between tags and how to prevent it?

隐身守侯 提交于 2019-12-04 10:27:14
I'm currently trying to work with docx files using PHPWord library and its templating system. I have found and updated someones (cant remember the name, but its not important) path to this library that can work with tables (replicate its rows and then use standard setValue() from PHPWord on each of row). If i create my own document, the data in xml is in normal structure, so the variable to be replaced ${variable} is in its own tag like this: <w:tbl> <w:tr> ... ${variable} </w:tr> </w:tbl> I simplified the code, in actual code there is number of other tags descibing sizes, styles, etc. My

Creating RTF , DOC , or DOCX in iOS

谁说我不能喝 提交于 2019-12-04 10:22:07
I want to create one of the following filetypes with an iOS-App: RTF, DOC or DOCX. The user should be able to write text and also add images to it. The building of the UI isn´t the problem, only the creating of the File. Are there any best practice to do this?! 3rd Party Frameworks are an option, but i would like to do it myself. Thanks I can help you for docx files (RTF files are easier and doc files are quite the same as docx but less well organised) I think the best you could do is to start by opening a docx file into a text editor. You have first to unzip the file. You will have the

How can I debug a corrupt docx file?

岁酱吖の 提交于 2019-12-04 09:26:59
问题 I have an issue where .doc and .pdf files are coming out OK but a .docx file is coming out corrupt. In order to solve that I am trying to debug why the .docx is corrupt. I learned that the docx format is much stricter with regard to extra characters than either .pdf or .doc. Therefore I have searched the various xml files WITHIN the docx file looking for invalid XML. But I can't find any. It all validates fine. Could anyone suggest directions for me to investigate now? UPDATE: The full