Questions tagged [system.io.packaging]

system.io.packaging is Microsoft's system for creating and packaging complex multi-part documents. It is used by Microsoft Office for common formats like xlsx and docx, among others.

System.IO.Packaging is Microsoft's system for creating and packaging complex multi-part documents. It is used by Microsoft Office for common formats like xlsx and docx, among others.

The Package format is essentially a ZIPped folder with the document contents, the Parts, normally placed in subfolders in the ZIP. You can examine a Package by renaming it .zip and opening it, for instance, an xlsx file.

System.IO.Packaging can also be used as a basic ZIP library, but it will insist on adding a file at the root called [Content Types].xml.

42 questions
0
votes
0 answers

Cannot get Uri for an in-memory object because of missing PackageStore class

I need to get the URI of an in-memory bitmap because the class I want to use accepts only bitmap URIs, not byte[] data. Also, I don't want to create temporary files for this purpose but operate only with the memory. In .NET Framework I can do…
undermind
  • 1,779
  • 13
  • 33
0
votes
0 answers

Adding an attribute to XmlWriter causes all namespaces to become aliased

Here is a line of XML found in an Excel book I created with a PivotTable/Cache in it:
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
0
votes
0 answers

Debugging a System.IO.Package out that won't open in Excel, possibly content_type.xml issue?

I'm trying to create a 2007+ Excel document (.xlsx), using nothing but VB.net and .net4.0 built-in classes. So I can't use any third party libraries, including Open XML SDK. The code already works fine for basic workbooks, multiple sheets, styles,…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
0
votes
0 answers

Manually re-compress an unzipped system.iopackage to a working Excel file

System.IO.Packaging is easy to work with because the resulting files are ZIPped folders, so you can simply rename the file to .zip and then open it. I do this with XLSX files to see how they are built. Unfortunately, the reverse is not true; if you…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
0
votes
0 answers

List of System.IO.Packaging ContentType strings?

I'm updating some older code that uses System.IO.Packaging to programmatically create Excel files. It ultimately calls CreatePackage on various bits of internal state to build out the documents. CreatePackage takes a ContentType parameter, and the…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
0
votes
0 answers

Get and set a package stream in password-protected OOXML files

Currently, we are using Sysyem.IO.Packaging namespace to get macros from various Office files. Package package = Package.Open(stream, FileMode.Open, FileAccess.Read); var pp = package.GetParts().FirstOrDefault(p =>…
Chuck Norris
  • 15,207
  • 15
  • 92
  • 123
0
votes
1 answer

Is there a way to determine whether a file can be opened as a System.IO.Packaging.Package?

If I have a filepath or stream, is there a static method I can use to determine whether the file/stream is a package, other than by trying to use Package.Open on the file/stream and catching the System.IO.FileFormatException?
ThunderFrame
  • 9,352
  • 2
  • 29
  • 60
0
votes
1 answer

Zip package with Unicode chars in file name can't be uncompressed with System.IO.Packaging.Package?

Have some troubles with file package manipulation. Here is short description of issue: If a package contains a file with Unicode characters in it, compressing of it works well(can open package and be uncompressed it in windows) but if try to use…
Weazel
  • 63
  • 6
0
votes
0 answers

Programmatically generate a NuGet package without NuGet.Core

I'm looking to generate a .nupkg containing a [single] [source] file on the fly without using the NuGet.Core lib or shelling out to a nuget.exe pack. As I understand it, in essence to generate a .nupkg with a single file in it should be a matter of…
Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
0
votes
1 answer

Package and chunk large directory for transfer

I have a folder structure that is about 7 levels deep, and contains about 1.0 million files of various sizes and formats. Everything in it that could be compressed has been. It's about 350GB. I want to push this entire directory into cloud…
Nicros
  • 5,031
  • 12
  • 57
  • 101
0
votes
1 answer

ASP.Net : system.io.packaging package "File contains corrupted data"

I am using system.io.packaging.package to create a package containing some files. Purpose is to create an import/export functionnality. I create the package like that : // Create the compressed file. using (FileStream outFile =…
Kaly
  • 47
  • 1
  • 8
0
votes
2 answers

Is there a Java library equivalent to Microsoft/.NET System.IO.Packaging?

Is there a Java library equivalent to System.IO.Packaging. If so what is the experience of unpacking DOCX files editing DOCX files building DOCX files from scratch.
peter.murray.rust
  • 37,407
  • 44
  • 153
  • 217
1 2
3