NickNaso / ghostscript4js

Ghostscript4JS binds the Ghostscript C API to the Node.JS world.
http://www.nacios.it
Apache License 2.0
68 stars 19 forks source link

spot color layer completely black using tiffsep #37

Closed daton89 closed 5 years ago

daton89 commented 6 years ago

Hi @NickNaso

thank you for this awesome work, it is really useful, but i had a problem that i guess is a bug.

When I try to use the tiffsep sDevice option some of the layers that are spot color are generated completely black.

I don't know the cause but if I try to run the same command in the shell it works.

// Run ghostscript
try {
    gs.executeSync('-dBATCH -dNOPAUSE -dSAFER -sDEVICE=tiffsep -dFirstPage=1 -dLastPage=1 -r144 -sOutputFile=output.tif "./input.pdf"')
} catch (err) {
    // Handle error
    console.error('gs =>', err)
}
NickNaso commented 6 years ago

Hi @daton89, you need to remove the quotation marks from the path of the pdf file and use one of the command reported in the example below:

'use strict'

const gs = require('ghostscript4js')

try {
    // Command as a string
    gs.executeSync('-dBATCH -dNOPAUSE -dSAFER -sDEVICE=tiffsep -dFirstPage=1 -dLastPage=1 -r144 -sOutputFile=output.tif ./input.pdf')
    // Command as array of parameters
    gs.executeSync(['-dBATCH', '-dNOPAUSE', '-dSAFER', '-sDEVICE=tiffsep' ,'-dFirstPage=1', '-dLastPage=1', '-r144', '-sOutputFile=output.tif', './input.pdf'])
} catch (err) {
    // Handle error
    throw err
}

I think that this should solve your problem. Keep me updated about this.

daton89 commented 6 years ago

Hi @NickNaso,

unfortunately it doesn't work.

Thanks