NickNaso / ghostscript4js

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

Conversion to PDF/A fails without error message #21

Closed manuschiller closed 7 years ago

manuschiller commented 7 years ago

I need to convert a pdf to pdf/a.

Therefore I tried to execute GS with the following script:

const gs = require('ghostscript4js')

try {
    gs.executeSync('-dPDFA -dBATCH -dNOPAUSE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=my-pdfa.pdf my-pdf.pdf')
} catch (err) {
    throw err
}

this creates the file my-pdf-a.pdf, but it is actually not converted to PDF/A.

If I run the exact same command on the same input pdf on the shell like gs -dPDFA -dBATCH -dNOPAUSE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=my-pdfa.pdf my-pdf.pdf

it correctly outputs the file my-pdfa.pdfas PDF/A.

NickNaso commented 7 years ago

Hi @manuschiller , could you report information about your system? Ghostscript version Node.js version Operanting System

NickNaso commented 7 years ago

Tested on Ghostscript 9.19 - 9.20 - 9.21 and Node.js v 7.x and 8.x all worked fine. My advice is to remove -dUseCIEColor option, it's not used from Ghostscript version 9.11.