Giter Site home page Giter Site logo

jamesalexthorburn / open-xml-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dotnet/open-xml-sdk

0.0 1.0 0.0 44.59 MB

Open XML SDK by Microsoft

Home Page: https://www.nuget.org/packages/DocumentFormat.OpenXml/

License: Apache License 2.0

C# 100.00% PowerShell 0.01%

open-xml-sdk's Introduction

Open-XML-SDK

Release Version 2.7

News: The Office2016 branch on this repo contains a preview of the Open-Xml-Sdk v2.7, which
supports the Office 2016 extensions in the file format.  The biggest change to the markup was
the introduction of the ExtendedChartPart, which support the new chart types, such as Waterfall,
Box and Whisker, and Sunburst.  You can specify FileFormatVersions.Office2016 to validate this
markup.  This version of the SDK also supports using the strongly-typed OM to access the markup
in the new parts.

We will merge the Office2016 branch into vNext at some point in the future, after receiving
feedback.

The Open XML SDK provides open-source libraries for working with Open XML Documents (DOCX, XLSX, and PPTX). It supports scenarios such as:

  • High-performance generation of word-processing documents, spreadsheets, and presentations.
  • Populating content in DOCX files from an XML data source.
  • Splitting up (shredding) a DOCX or PPTX file into multiple files, and combining multiple DOCX / PPTX files into a single file.
  • High fidelity conversion of DOCX => HTML/CSS and HTML/CSS => DOCX.
  • Extraction of data from XLSX.
  • Searching and replacing content in DOCX / PPTX using regular expressions.
  • Updating cached data and embedded spreadsheets for charts in DOCX / PPTX.
  • Document modification, such as removing tracked revisions or removing unacceptable content from documents.

Open-Xml-PowerTools provides example code and guidance for implementing many of the above important Open XML scenarios. Be sure to check it out before re-inventing your own solutions.

Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

Portions of this project are licensed under the MIT license. See MIT-License.txt in the project root for license information.

The Release Package on Nuget.org

The official release NuGet packages for Open XML SDK are available on Nuget.org at https://www.nuget.org/packages/DocumentFormat.OpenXml.

The Latest Builds

Where to get the NuGet packages of the latest builds?

The NuGet package for the latest builds of the Open XML SDK is available as a custom feed on MyGet. You can trust this package source, since the custom feed is locked and only this project feeds into the source.

WindowsBase or System.IO.Packaging

There is a known issue in WindowsBase that causes crashes when handling large data sources. This is fixed in later versions of the library, based on the platform availability of the System.IO.Packaging package. When possible, we use this package instead of WindowsBase. This not only fixes the crash seen by some users, but is available cross platform. However, it is only available on .NET Standard 1.3+ and .NET Framework 4.6+. For this reason, the NuGet package has multiple targets to bring in this when possible. The targets (which are determined by NuGet at installation and build time) are:

Platform System.IO.Packing Source Tested by
.NET 3.5 WindowsBase N/A
.NET 4.0 WindowsBase .NET 4.5.2
.NET 4.6 NuGet .NET 4.6
.NET Standard NuGet .NET Core 1.0

How to install the NuGet package?

The package you want to install is DocumentFormat.OpenXml.

NuGet packages are available for release builds or CI Builds and follow semantic versioning.

The package feed or the package source is specified by the feed URL. Depending on your version of Visual Studio, choose the appropriate feed URL from the table below.

Table 1: The latest builds are available via a MyGet feed

Client Feed URL
NuGet V3 (Visual Studio 2015+) https://dotnet.myget.org/F/open-xml-sdk/api/v3/index.json
NuGet V2 (Visual Studio 2012+) https://dotnet.myget.org/F/open-xml-sdk/api/v2

The Install-Package command considers the package source either via configuration or argument. Also the package version can vary. For the latest version info, see https://dotnet.myget.org/feed/open-xml-sdk/package/nuget/DocumentFormat.OpenXml

  • To specify the package source via a configuration option, see https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior. Note that usually a NuGet.config file is placed in the directory and the configuration options are added there to ensure the sources are persisted in the version control.

     PM> Install-Package DocumentFormat.OpenXml -Version <version retrieved from the web>
    
  • To pass the feed URL as an argument, here is an example for Visual Studio 2015 and later.

     PM> Install-Package DocumentFormat.OpenXml -Version <version retrieved from the web> -Source https://dotnet.myget.org/F/open-xml-sdk/api/v3/index.json 
    

Note: If you have trouble installing the package, try restarting Visual Studio. Package sources could be cached, and changes you've made to any NuGet.config files may not be detected.

Having Problems?

If you want to report a problem (bug, behavior, build, distribution, feature request, etc... ) with the SDK built by this repository, please feel free to post a new issue and the someone will try to help out.

If you have "how-to" questions please post to one of the following resources:

News

We are also happy to announce the release of Open-Xml-PowerTools on GitHub. Open-Xml-PowerTools provides example code and guidance for implementing a wide range of Open XML scenarios. You can find PowerTools for Open XML, which previously lived at PowerTools.CodePlex.com at github.com/OfficeDev/Open-Xml-PowerTools.

Change Log

Version 2.7.2 : June 6, 2017

  • Fixed issue where assembly version wasn't set in assembly
  • Added support for .NET 3.5 and .NET 4.0

Version 2.7.1 : January 31, 2017

  • Fixed crash when validation is invoked on .NET Framework with strong-naming enforced

Version 2.7.0 : January 24, 2017

  • Added support for .NET Standard 1.3
  • Moved to using System.IO.Packaging from dotnet/corefx for .NET Standard 1.3 and WindowsBase for .NET 4.5
  • Cleaned up project build system to use .NET CLI

Version 2.6.1 : January 15, 2016

  • Added hundreds of XUnit tests. There are now a total of 1333 tests. They take about 20 minutes to run, so be patient.

Version 2.6.0 : June 29, 2015

Documentation

The functionality of the specific classes in Open XML SDK Version 2.7.0 is similar to version 2.5, therefore the documentation available on MSDN is still accurate.

Open XML SDK 2.5 for Office

In addition to open sourcing of the SDK, Microsoft has opened up the conceptual documentation for public review / contributions. A copy of the documentation is now in GitHub for you to edit and review.

Build Instructions

This project uses the new csproj format and the release versions of the tooling in Visual Studio 2017. For more information on how to use this project type to build your project, see the release notes for Visual Studio 2017: https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes#dotnetcore. Other editors that support the latest .NET project files include VS Code, VS for Mac, or .NET CLI. See https://www.microsoft.com/net/download/core for details.

To build the Open XML SDK:

  • Clone the repo at https://github.com/OfficeDev/Open-XML-SDK
  • Open the solution with an editor that supports the latest .NET project files
  • Build the solution (using either Debug or Release configuration)
  • Run the Xunit tests to verify the installation

If you want to use a command line approach:

  • Go to the directory the solution is in
  • Run dotnet restore in the directory
  • Run dotnet test DocumentFormat.OpenXml.Tests to run the tests
  • Run dotnet pack DocumentFormat.OpenXml to generate a nupkg

Schema Files

The data for schema validation is contained in static binary files that are not compatible in .NET Standard. At this moment, a converter tool is used to transform the binary file into a set of POCO objects that will not require deserialization at runtime. This tool is located in the BinaryFormatConverter folder. In order to run it:

  • Run dotnet restore in the solution directory
  • cd BinaryFormatConverter
  • dotnet run

This will go through and update schema files in the form of DocumentFormat.OpenXml/src/GeneratedCode/Office*Schema.cs. This update only needs to be run when there is a change to the binary files; otherwise, they will return the same result. These updated files are only used in the .NET Sandard implementation, while the binary files will continue to be used in the .NET 4.5 builds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.