Skip to content

Commit

Permalink
Add manual test for issue #51
Browse files Browse the repository at this point in the history
  • Loading branch information
victordidenko committed Jun 6, 2023
1 parent 1cf5c7a commit c2c64b0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
Binary file added test/manual/in1.docx
Binary file not shown.
Binary file added test/manual/in2.docx
Binary file not shown.
Binary file added test/manual/in3.docx
Binary file not shown.
30 changes: 30 additions & 0 deletions test/manual/test_issue_51.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import fs from 'fs'
import * as got from '../../src'

// need to run Gotenberg like this
// docker run --rm -p 3500:3000 gotenberg/gotenberg:7

got
.pipe(
got.gotenberg(''),
got.merge,
got.adjust({
// manually adjust endpoint, because
// gotenberg:7 has different one
url: 'http://localhost:3500/forms/libreoffice/convert',

// manually adjust for fields
fields: {
merge: true,
// `merge` is not valid field for gotenberg:6
// so we have to cast to any, otherwise typescript will complain
} as any, // if you don't use typescript, just remove `as any` casting
}),
got.please
)({
'in1.docx': `file://${__dirname}/in1.docx`,
'in2.docx': `file://${__dirname}/in2.docx`,
'in3.docx': `file://${__dirname}/in3.docx`,
})
.then((pdf) => pdf.pipe(fs.createWriteStream(`${__dirname}/out1.pdf`)))
.catch(console.error)

0 comments on commit c2c64b0

Please sign in to comment.