[gs-devel] Problems with stdin and return code -110

Sheri Steeves Sheri_Steeves at peernet.com
Thu Feb 5 08:08:12 PST 2009


Hello, 

I'm using the gs api from within a windows program to open PDF, PS and EPS files and create output images.

I now have to handle wide filenames with Unicode characters such as Arabic and Chinese symbols, and am redirecting stdin to read from a file handle to bypass the narrow restriction. 
 
When reading from the stdin, while the output file is created, I am getting a return code of -101, which is "Ghostscript failed to open the file." I am using a PS file, the docs say this shouldn't work for a PDF.

I do not fall into any error cased from my stdin callback. I am passing "-_" to my gsarv and opening my file with:

_topen( (LPCTSTR) szFile, _O_BINARY, _S_IREAD ) ;

Am I missing a command line argument or something? Any help is appreciated!

My stdin callback is declared as follows, extra error checking removed
int GSDLLCALL pn_stdin( void *caller_handle, char *buf, int len) {
    int nRead, fh = 0 ;

    fh = pJobProcessor->GetGSConverter()->GetFileHandle();

    nRead = _read( fh, buf, len ) ;
    return nRead ;
}

 Best Regards,
Sheri


More information about the gs-devel mailing list