Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docx2pdfmaker

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docx2pdfmaker - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

17

index.js

@@ -8,3 +8,3 @@ const jsdom = require('jsdom')

async function ConvertToPdf (data, type, options) {
async function ConvertToPdf (data, type, options, tableLayout) {
let input = {}

@@ -33,6 +33,8 @@

if (item.nodeName === 'TABLE') {
const { formatTable, formatWidth } = makeRowHaveTheSameNumberOfColumns(item.table.body)
return {
...item,
table: {
body: makeRowHaveTheSameNumberOfColumns(item.table.body)
widths: formatWidth,
body: formatTable
}

@@ -46,3 +48,2 @@ }

const dd = {
pageMargins: [10, 25, 10, 60],
content: convertedContent

@@ -56,3 +57,3 @@ }

function makeRowHaveTheSameNumberOfColumns (table) {
const formatTable = table.map(row => {
const formatTable = table.map((row, index) => {
// make all rows have the same number of columns

@@ -83,5 +84,11 @@ const numberOfColumns = Math.max(...table.map(row => row.length))

return formatTable
const formatWidth = []
const numberOfColumns = Math.max(...formatTable.map(row => row.length))
for (let i = 0; i < numberOfColumns; i++) {
formatWidth.push('*')
}
return { formatTable, formatWidth }
}
module.exports = { ConvertToPdf }
{
"name": "docx2pdfmaker",
"version": "0.0.2",
"version": "0.0.3",
"description": "NPM Package to convert .Docx file into Pdfmaker libary format",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -43,2 +43,2 @@ <h1 align="center">

Check the [demo folder](https://github.com/Igorcbraz/Docx2PdfMaker/tree/main/examples) for examples.
Check the [demo folder](https://github.com/Igorcbraz/Docx2PdfMaker/tree/main/example) for examples.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc