docx

DOCX to good quality PNG conversion using docx4j in java

孤人 提交于 2019-12-24 21:23:19
问题 I am trying to convert a .docx document into a .png file using Docx4j in java , and achieved the conversion using the piece of code below. However, the output png file is not of good quality, the text is quite hazy, especially for the images that were present inside the docx file as a part of the document page. I want to improve the quality of the generated image, for that, I tried using the docx.properties file and increase the DPI, but it did not have any effect. WordprocessingMLPackage

DocX with filestream doesn't save

主宰稳场 提交于 2019-12-24 19:28:29
问题 So for a project I am creating Résumé's and i need to save them into a docx file. It is a ASP.NET MVC application and for the docx generating I'm using the libray docx to create the document. I can create the file but the filestream doesn't add the content i put into it. Here is a the code i use public ActionResult CVToWord(int id) { var CV = CVDAO.CV.Single(cv => cv.id == id); var filename = "CV - " + CV.firstname + " " + CV.name + " - " + CV.creationdate.ToString("dd MM yyyy") + ".docx";

Exact same file and code. So why does the binary of my docx file always end differently?

∥☆過路亽.° 提交于 2019-12-24 14:21:52
问题 We take a (non-corrupted) .docx file from our server and post it via httprequest to an API. When downloading it from the API it comes out corrupted. I 99% sure that this is down to the code that posts the file, not the API. It turns out the corrupted file had some extra characters in the binary - I thought it would be pretty easy to find out where they came from and remove them. Boy was I wrong. I've since realised that every time we post the file, the binary ending is slightly different. We

Change a value in embedded xlsx with apache poi

谁都会走 提交于 2019-12-24 13:45:24
问题 I tried to change a value of a xlsx-file which is embedded in a docx-file with apache poi. Sadly, I havent found a proper solution to this problem. After running my programm, the new created docx-file with the embedded xlsx-table hasnt changed. Here is what I have tried so far: FileInputStream fis = new FileInputStream("old.docx"); XWPFDocument xdoc = new XWPFDocument(OPCPackage.open(fis)); System.out.println(xdoc.getAllEmbedds().get(0)); File file2 = new File("new.docx"); for (PackagePart

Convert DOCX to HTML incliding IMAGES

送分小仙女□ 提交于 2019-12-24 13:13:34
问题 I am using DOCX4J to convert the DOCX to HTML .I have successfully done the conversion and got the html format.I will be using the html format to embed it as EMAIL body to send an email.But I have some issues which are listed below.... Unable to display images in email body Losing the spaces and bullets Please find the code which I have written, WordprocessingMLPackage wordMLPackage; wordMLPackage = Docx4J.load(new java.io.File(resourcePath2)); HTMLSettings htmlSettings = Docx4J

Finding a heading in word file and copying entire paragraph thereafter to new word file with python

爷,独闯天下 提交于 2019-12-24 07:54:29
问题 I have the following situation: I have several hundred word files that contain company information. I would like to search these files for specific words to find specific paragraphs and copy just these paragraphs to new word files. Basically I just need to reduce the original couple hundred documents to a more readable size each. The documents that I have are located in one directory and carry different names. In each of them I want to extract particular information that I need to define

How do you create multi-level ordered lists with Open XML in ASP.net?

半腔热情 提交于 2019-12-24 03:48:10
问题 I've spent countless hours trying to understand ordered lists in Open XML. Here's one of many references. I found this incredibly helpful example of a simple document creator here. Also if I may gripe a little bit, I must say this is a painful learning curve. Creating numbering properties and referencing the correct abstractNumberId and the list goes on and on. Does anyone have a complete example of creating multi-level lists in code? I can do so with no custom settings, as in setting the

How to create a header/footer in new docx document?

故事扮演 提交于 2019-12-24 02:18:59
问题 I would like to create a header and footer on a docx document (a new one and not existing one) with XWPF jars (apache poi). When I use XWPFHeaderFooterPolicy policy = document.getHeaderFooterPolicy(); policy is null, so I would know how to create it in a new document. CustomXWPFDocument document = new CustomXWPFDocument(); XWPFHeaderFooterPolicy policy = document.getHeaderFooterPolicy(); XWPFHeader head = policy.createHeader(policy.DEFAULT); head.getListParagraph().get(0).createRun().setText(

How to to save one document based on an if statement in Python?

假如想象 提交于 2019-12-24 01:17:47
问题 I am trying to save a document based on a if statement. Here I am creating radiobuttons: info = ["Option 1", "Option 2", "Option 3"] vars = [] for idx,i in enumerate(info): var = IntVar(value=0) vars.append(var) lblOption = Label(main,text=i) btnYes = Radiobutton(main, text="Yes", variable=var, value=2) btnNo = Radiobutton(main, text="No", variable=var, value=1) btnNa = Radiobutton(main, text="N/A", variable=var,value=0) lblOption.grid(column=4,row=idx, sticky = W) btnYes.grid(column=1,row

Convert DOC to PDF [closed]

依然范特西╮ 提交于 2019-12-24 00:58:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I know this question has been asked over and over, but I can't find the answer I'm looking for. So I'll shamelessly try again. I'm