Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing Office Rels #319

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add missing Office Rels
This makes the workbook properties appear correctly on the properties window inside MS Excel
  • Loading branch information
mauriciovillalobos committed May 17, 2017
commit f0afea0f30139f1023b86642dc6e24821d4926fa
4 changes: 3 additions & 1 deletion lib/stream/xlsx/workbook-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 193,9 @@ WorkbookWriter.prototype = {
return new PromishLib.Promish(function(resolve) {
var xform = new RelationshipsXform();
var xml = xform.toXml([
{Id: 'rId1', Type: RelType.OfficeDocument, Target: 'xl/workbook.xml'}
{Id: 'rId1', Type: RelType.OfficeDocument, Target: 'xl/workbook.xml'},
{Id: 'rId2', Type: RelType.CoreProperties, Target: 'docProps/core.xml'},
{Id: 'rId3', Type: RelType.ExtenderProperties, Target: 'docProps/app.xml'}
]);
self.zip.append(xml, {name: '/_rels/.rels'});
resolve();
Expand Down
2 changes: 2 additions & 0 deletions lib/xlsx/rel-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 15,6 @@ module.exports = {
Theme: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
Hyperlink: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
Image: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
CoreProperties: 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
ExtenderProperties: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties',
};
4 changes: 3 additions & 1 deletion lib/xlsx/xlsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 472,9 @@ XLSX.prototype = {
return new PromishLib.Promish(function(resolve) {
var xform = new RelationshipsXform();
var xml = xform.toXml([
{Id: 'rId1', Type: XLSX.RelType.OfficeDocument, Target: 'xl/workbook.xml'}
{Id: 'rId1', Type: XLSX.RelType.OfficeDocument, Target: 'xl/workbook.xml'},
{Id: 'rId2', Type: XLSX.RelType.CoreProperties, Target: 'docProps/core.xml'},
{Id: 'rId3', Type: XLSX.RelType.ExtenderProperties, Target: 'docProps/app.xml'}
]);
zip.append(xml, {name: '_rels/.rels'});
resolve();
Expand Down