Ziv-Barber / officegen

Standalone Office Open XML files (Microsoft Office 2007 and later) generator for Word (docx), PowerPoint (pptx) and Excell (xlsx) in javascript. The output is a stream.
MIT License
2.65k stars 471 forks source link

How to generate two columns page in docx? #272

Closed naveedaheer closed 5 years ago

naveedaheer commented 6 years ago

Can we generate a docx that should be two columns layout?

OctoberCity commented 6 years ago

I am trying to compare xml files, trying to find a solution

naveedaheer commented 6 years ago

I got the solution.

naveedaheer commented 6 years ago

In node_modules/lib/gendocx.js

outString += '<w:sectPr w:rsidR="00A02F19" w:rsidSect="00897086">' + (docxData.secPrExtra ? docxData.secPrExtra : '') + '<w:pgSz w:w="15840" w:h="12240" w:orient="landscape"/>' + '<w:pgMar w:top="1800" w:right="1440" w:bottom="1800" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>' + '<w:cols w:space="720"/>' + '<w:docGrid w:linePitch="360"/>' + '</w:sectPr>';

I replaced '<w:cols w:num="2" w:space="720"/>'

OctoberCity commented 6 years ago

good job!!!1

OctoberCity commented 6 years ago

@naveedaheer My business is troublesome, I have to use other methods, such as html conversion to docx, I think it will be more effective