docx

How generate docx/odt file with math formulas from java

只愿长相守 提交于 2019-12-13 17:20:49
问题 Good day. I must generete docx or odt file with many math formulas inside. i try to find solution in Apashe POI & ODFtoolkit but i am not was able. google doesn't help. ( May be anybody can help me with solution in this task? (any example?) Thanks. 回答1: You could use the docx4j library. Here is the documentation for Getting started. I recommend that you create a template file first, with all the formatting, and as much structure as you can. Then you should put in content-controls where you

Writing Binary to a Word Document [closed]

风格不统一 提交于 2019-12-13 08:58:03
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 14 days ago . document_binary = py.view_binary(id['id']) #view_binary is a function that makes an API call to get the binary #string of a document storage in a file space.It takes the ID of the #document as the parameter and returns binary string binary_stream = io.BytesIO() binary_stream.write(document_binary

Open a paperclip attached word doc in Ruby/rails

人走茶凉 提交于 2019-12-13 08:57:50
问题 I have a rails app with file attachments using paperclip. Images and pdfs work fine in that if I click on the linked attachment, the image or pdf opens. If I right click, I can do a save-as. However, with Office files such as word.docx, I can only download the file. If I go do Dos and type the filename, it will open in MS word. Therefore, I think that I should be able to use the system or system call and just pass the attachment name from paperclip (ie attachment.image.url) to dos and the

Apache POI characters run for .docx

天涯浪子 提交于 2019-12-13 06:48:53
问题 In .doc files, There is a function to get each character in paragraph by using CharacterRun charrun = paragraph.getCharacterRun(k++); and then I can use those character runs to inspect their attributes like if ( charrun.isBold() == true) System.out.print(charrun.text()); or something like that. But with .docx files seems to have no characters run method that can read each word like that, I tried to use XWPFParagraph item = paragraph.get(i); List<XWPFRun> charrun = item.getRuns(); I found that

Decreasing the vertical space when using the paragraph function in the python docx module

人走茶凉 提交于 2019-12-13 05:41:16
问题 I am adding single line text something like this string = "This is just some text." using the docx.paragraph function to a word document. It works fine, except I would like to make the vertical spacing between the texts less. Any ideas how I can do that. Thanks. 回答1: I have created a test docx, the first two paragraphs are spaced with normal spacing, and the two next paragraph are spaced with more spacing: The first two paragraphs have the following structure (document.xml, see the Tag Wiki)

Java byteArray[] to docx

China☆狼群 提交于 2019-12-13 05:16:45
问题 doc file in byte[] type. Is it possible to convert it from byte[] into .docx file. tried just change file extension programilly but it does not work. any suggestions? I generate report using BiRT eclipse code of saving doc: options = new RenderOptionBase(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); options.setOutputStream(bos); options.setOutputFormat("doc"); if(parameters != null){ task.setParameterValues(parameters); } task.setRenderOption(options); task.run(); return bos

Change font size in text box - apache poi word docx

∥☆過路亽.° 提交于 2019-12-13 03:44:45
问题 I found the answer that explains how to insert a new text box into docx document. create text box in document .docx using apache poi The problem is that I cannot change the font size inside a newly created text box. Does anyone know how to do that? 回答1: Reference : create text box in document .docx using apache poi The ctTxbxContent.addNewP() in my code creates a CTP object. The XWPFParagraph has a constructor XWPFParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP prgrph,

How to open password protected docx file in java?

扶醉桌前 提交于 2019-12-13 03:33:09
问题 I want to open a password protected docx file using Apache POI. Can anyone help me with the complete code please? Am not getting solution with this code Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF) at org.apache.poi.poifs.storage.HeaderBlock.

Table text gets extra spacing after running through word automation services

不打扰是莪最后的温柔 提交于 2019-12-13 02:38:14
问题 I'm generating a document from a bunch of template documents and in addition I'm adding some tables as html altChunk s (because it's a lot easier than trying to create a table with OpenXML). This all worked fine and gave me the result I wanted. But, because of some deficiencies with the way altChunk were being processed by some versions of Word (especially on the Mac) and the inability to automatically update the TOC, we decided to set it up to run our reports through word automation services

Question Regarding XML Parsing Using SAX in JAVA

我与影子孤独终老i 提交于 2019-12-13 00:14:22
问题 I am trying to parse an XML document in Java (first time attempting to do so), and I have found a number of articles on Google that provide examples but I really don't understand some of the code in them, so I was wondering if someone could explain a few things to me. The primary example I was looking at came from here: http://www.java-tips.org/java-se-tips/org.xml.sax/parsing-xml-with-a-simple-sax-document-handler-2.html. My main questions primarily come from the second half of the code,