상세 컨텐츠

본문 제목

[WPF] word -> FlowDocument 할때 필요한 dll

WPF

by happynuri 2008. 7. 10. 11:32

본문

What is the Difference Between the System.IO.Packaging and DocumentFormat.OpenXml.Packaging Namespaces?

There are two separate namespaces, each containing a number of classes, which you can use to open and get at the contents of Open XML documents.

  • System.IO.Packaging is part of the .NET Framework 3.0 and 3.5. The classes are in the WindowsBase assembly.
  • DocumentFormat.OpenXml.Packaging is in an external assembly that you can download and install. The classes are in the DocumentFormat.OpenXml assembly.

Note that neither of the above namespaces help in any way with consuming the XML in the parts. You must still use an XML programming API, such as XmlReader, XmlDocument (or best, LINQ to XML), to consume and if necessary, produce the XML.

To use either of the above two namespaces, you need to add a reference to the appropriate assembly.

The OpenXmlPackaging download can be found here:

http://go.microsoft.com/fwlink/?linkid=120908

You can find documentation for DocumentFormat.OpenXml.Packaging here:

http://msdn2.microsoft.com/en-us/library/bb448854.aspx

There is a bit of confusion about which of these to use.

System.IO.Packaging

As detailed in Packages and Parts, packages are zip files that contain a number of parts, primarily XML, but also can contain other types of parts, such as images.

System.IO.Packaging provides classes that allow you to get at the contents of these zip files. However, it isn’t raw zipfile access; it provides means to use the relationships to navigate from part to part. This navigation is untyped. You use strings to identify the content types, and retrieve part types that are not strongly typed.


관련글 더보기

댓글 영역