openxml

How to add text on desired coordinates on new word file using openxml

不问归期 提交于 2019-12-31 03:46:10
问题 I want to create .docx file using openxml and add text on desired coordinates(location) on each page of the file. Is there any way in openxml to adjust the text. I am using the following snippet: WordprocessingDocument doc = WordprocessingDocument.Create("E:\\test11.docx", DocumentFormat.OpenXml.WordprocessingDocumentType.Document); { MainDocumentPart mainPart = doc.AddMainDocumentPart(); mainPart.Document = new Document(); Body body = mainPart.Document.AppendChild(new Body()); Paragraph para

OpenXml Excel: throw error in any word after mail address

随声附和 提交于 2019-12-30 18:38:38
问题 I read Excel files using OpenXml. all work fine but if the spreadsheet contains one cell that has an address mail and after it a space and another word, such as: abc@abc.com abc It throws an exception immediately at the opening of the spreadsheet: var _doc = SpreadsheetDocument.Open(_filePath, false); exception: DocumentFormat.OpenXml.Packaging.OpenXmlPackageException Additional information: Invalid Hyperlink: Malformed URI is embedded as a hyperlink in the document. 回答1: There is an open

How can I retrieve images from a .pptx file using MS Open XML SDK?

南楼画角 提交于 2019-12-30 09:33:03
问题 I started experimenting with Open XML SDK 2.0 for Microsoft Office. I'm currently able to do certain things such as retrieve all texts in each slide, and get the size of the presentation. For example, I do the latter this way: using (var doc = PresentationDocument.Open(pptx_filename, false)) { var presentation = doc.PresentationPart.Presentation; Debug.Print("width: " + (presentation.SlideSize.Cx / 9525.0).ToString()); Debug.Print("height: " + (presentation.SlideSize.Cy / 9525.0).ToString());

How can I retrieve images from a .pptx file using MS Open XML SDK?

谁都会走 提交于 2019-12-30 09:32:27
问题 I started experimenting with Open XML SDK 2.0 for Microsoft Office. I'm currently able to do certain things such as retrieve all texts in each slide, and get the size of the presentation. For example, I do the latter this way: using (var doc = PresentationDocument.Open(pptx_filename, false)) { var presentation = doc.PresentationPart.Presentation; Debug.Print("width: " + (presentation.SlideSize.Cx / 9525.0).ToString()); Debug.Print("height: " + (presentation.SlideSize.Cy / 9525.0).ToString());

Streaming In Memory Word Document using OpenXML SDK w/ASP.NET results in “corrupt” document

你离开我真会死。 提交于 2019-12-30 05:43:26
问题 I am unable to stream a word document that I create on the fly down to the browser. I am constantly getting a message from Microsoft Word that the document is corrupt. When I run the code via a Console Application and take ASP.NET out of the picture, the document is generated correctly with no problems. I believe everything centers around writing the file down. Here is my code: using (MemoryStream mem = new MemoryStream()) { // Create Document using (WordprocessingDocument wordDocument =

How can I create multistyled cell with EPPlus library for Excel

眉间皱痕 提交于 2019-12-30 03:44:10
问题 I use EPPlus for Excel file generation. I mean I need to convert HTML text (bold, italic, font color, name, size parameters) to Excel Cell. I suppose it needs to create the multi-styled cell, like: cell text is "hello!" the style I want is: he - bold ll - italic o! - red colored font or (more complex) hello! - bold ll - italic (also bold) o! - red colored (also bold) I know about MS OpenXML library (it allows me to do what I need). This is good but bit more complex library for implementation.

OpenXML to Create a DataTable from Excel - Money Cell Value Incorrect

断了今生、忘了曾经 提交于 2019-12-29 09:14:07
问题 I am attempting to create a datatable from an Excel spreadsheet using OpenXML. When getting a row's cell value using Cell.CellValue.innerXml the value returned for a monetary value entered by the user and visible on the spreadsheet is not the same value interpreted. The spreadsheet cell is formatted as Text and the cell value is 570.81. When obtaining the data in OpenXML the value is interpreted as 570.80999999999995. This method is used for many different excel imports where the data type

Is it possible to update a PowerPoint slide with new data (in C#)?

久未见 提交于 2019-12-29 06:34:12
问题 Are there any examples out there on how to update a PowerPoint slide (by clearing the text in a certain textbox and updating it with new content)? I have a monthly report to generate in PowerPoint and I have all the data in a database. I am trying to determine if I can simply autogenerate the slides by having a blank PowerPoint template with three textboxes and the data would get filled in from my C# code. The other examples i would look for are: bulletted lists tables Any help in the right

Is it possible to update a PowerPoint slide with new data (in C#)?

跟風遠走 提交于 2019-12-29 06:33:29
问题 Are there any examples out there on how to update a PowerPoint slide (by clearing the text in a certain textbox and updating it with new content)? I have a monthly report to generate in PowerPoint and I have all the data in a database. I am trying to determine if I can simply autogenerate the slides by having a blank PowerPoint template with three textboxes and the data would get filled in from my C# code. The other examples i would look for are: bulletted lists tables Any help in the right

How to create Excel file using OpenXML without creating a local file?

血红的双手。 提交于 2019-12-28 05:58:11
问题 Is it possible to create and edit an excel document using OpenXML SDK without creating a local file? As per the documentation the Create method demands for a filepath , which creates a local copy of the file. SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(filepath, SpreadsheetDocumentType.Workbook); I'm referring the MSDN article here: https://msdn.microsoft.com/en-us/library/office/ff478153.aspx My requirement is to create the file, and it should be downloaded by the