wnabil / ngx-export-as

Angular 2+ / Ionic 2+ HTML/table element to export it as JSON, XML, PNG, CSV, TXT, MS-Word, Ms-Excel, PDF
MIT License
68 stars 40 forks source link

Margins option for PDF #49

Closed lunaeidi closed 4 years ago

lunaeidi commented 4 years ago

I have the code below as config, and the margins are not being applied. Am I missing something? Thank you!


    type: 'pdf',
    elementId: 'test',
    options: {
      orientation: 'landscape',
      margins: {
        top: '20',
        left: '20',
        right: '20'
      }
    }
  }```
wnabil commented 4 years ago

config: ExportAsConfig = {
    type: 'pdf',
    elementId: 'test',
    options: {
      jsPDF: {
        orientation: 'landscape',
        margins: {
          top: '20',
          left: '20',
          right: '20'
        }
      },
    }
  };```
check the demo
https://github.com/wnabil/ngx-export-as/blob/master/src/app/app.component.ts