caiyexiang / html-docx-js-typescript Goto Github PK
View Code? Open in Web Editor NEWConvert HTML documents to docx format.
License: MIT License
Convert HTML documents to docx format.
License: MIT License
能否添加自定义纸张宽高的配置,或者有其他方式修改吗
German letters and euro signs are incorrectly saved into word.
ä = ä
€ = â
页面上table表格为实线,导出后在word里成虚线了,怎么处理?
Hi @caiyexiang !
Whatever I try, the margin options are not taken into account. I don't want any margins for my document, and I want it to be in landscape mode:
const opt = {
margin: {
top: 0,
left: 0,
right: 0,
bottom: 0,
header: 0,
footer: 0,
gutter: 0
},
orientation: 'landscape' as const
}
Whatever I enter in the margin object, the margins are always 1 inch in the exported document:
Am I missing something here?
Thanks in advance for helping me out.
Kr
Klaas
ERROR in node_modules/html-docx-js-typescript/dist/internal.d.ts(2,8): error TS1192: Module '"pathTo/angular/node_modules/html-docx-js-typescript/node_modules/jszip/index"' has no default export.
When the typings for file-saver '@types/file-saver' are installed the code from your usage does not compile.
import { asBlob } from 'html-docx-js-typescript'
import { saveAs } from 'file-saver'
function saveDocx() {
asBlob("htmlString").then(data => {
saveAs(data, 'file.docx') // save as docx file
}) // asBlob() return Promise<Blob|Buffer>
}
Error Message:
error TS2769: No overload matches this call.
Overload 1 of 2, '(data: string | Blob, filename?: string | undefined, options?: FileSaverOptions | undefined): void', gave the following error.
Argument of type 'Blob | Buffer' is not assignable to parameter of type 'string | Blob'.
Type 'Buffer' is not assignable to type 'string | Blob'.
Type 'Buffer' is not assignable to type 'string'.
Overload 2 of 2, '(data: string | Blob, filename?: string | undefined, disableAutoBOM?: boolean | undefined): void', gave the following error.
Argument of type 'Blob | Buffer' is not assignable to parameter of type 'string | Blob'.
6 saveAs(data, 'file.docx') // save as docx file
hi, lib is working but export the file docx and no show data in this file, and i create data and the size file is more big
On mobile and mac when i try to open download file it always show me the message
"The document could not be opened. The file isn’t in the correct format."
I am using this with angular 8.
Can you support the linux ?
RT
Thank for your work!
Please add feature so that we can change page size according to input parameter.
The original JS project already has this update, the link is here:
evidenceprime/html-docx-js#7
Many thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.