-
The screenshot below shows 2 documents-My Document(37), and My Document(38). Code used to generate 37 is as follows:
The template building is basically the same as the demo app-https://runkit.com/dolanmiu/docx-demo4 Also tried decoding the base64 string using https://base64.guru/converter/decode/file and got the doc with a broken format similar to 37. (Did this to verify if the AWS API gateway is changing something) Tried Buffer object also but yielded the same results. Hoping someone could help in identifying why the doc does not retain the formatting. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Apparently, it is not the base 64 conversion that is the issue. It is actually the version of the library that was different- I am using 7.4.1 but the demo is using 6.0.1 where something has changed with the margins of a doc. Just putting here for reference: @dolanmiu are there any ways to get the same result in the newer versions i.e. getting margins in the document like in 6.0.1? |
Beta Was this translation helpful? Give feedback.
-
Could you try explicitly adding margins to the page like so: https://github.com/dolanmiu/docx/blob/master/demo/6-page-borders.ts |
Beta Was this translation helpful? Give feedback.
Could you try explicitly adding margins to the page like so:
https://github.com/dolanmiu/docx/blob/master/demo/6-page-borders.ts