Git Product home page Git Product logo

html-docx-js-typescript's People

Contributors

caiyexiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

html-docx-js-typescript's Issues

1

能否添加自定义纸张宽高的配置,或者有其他方式修改吗

导出的文件无法在手机或者平板上打开

导出的docx文件在电脑上打开后左下角会显示兼容模式,在手机或平板打开是空白的,只能在电脑打开。
3

如果在电脑端点击兼容模式,升级以后,就能够在手机或平板打开了,有什么办法或参数可以避免

Margins not taken into account

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:
image

Am I missing something here?

Thanks in advance for helping me out.

Kr
Klaas

Error jszip has no default export

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.

Code from usage example does not compile with typings

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

export file docx

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.