yumauri / gotenberg-js-client

A simple JS/TS client for interacting with a Gotenberg API
MIT License
110 stars 9 forks source link

404 Not found Error #39

Closed a0yan closed 2 years ago

a0yan commented 2 years ago
const {
    pipe,
    gotenberg,
    convert,
    markdown,
    office,
    to,
    landscape,
    set,
    filename,
    please,
  } = require('gotenberg-js-client')

  const toPDF = pipe(
    gotenberg('http://localhost:3000'),
    convert,
    office,
    to(landscape),
    set(filename('result.pdf')),
    please
  )

  // --- 8< ---

  // --- 8< ---

app.get('/api/convert_docs',async(req,res)=>{

    try {
        const pdf = await toPDF('file://mock_amikus_2.docx')

    } catch (error) {
        console.error(error.message)
    }
yumauri commented 2 years ago

Hello! Does Gotenberg listen on http://localhost:3000 and if yes — what version of Gotenberg do you use?

yumauri commented 2 years ago

@a0yan if you are using Gotenberg version 7.x — this library is not yet fully compatible with it. Among other things it has changed conversion URLs, so it might cause 404 error. Please, read this comment, I've pointed, how you can work around this problem for a while.

a0yan commented 2 years ago

@yumauri Thanxx