[gs-devel] Ghostscript API Failing

Ghazanfar Ali ghazanfar.ali at ascertia.com
Mon Apr 20 22:32:41 PDT 2009


Hi All,

I am developing an application in C++ that converts the PS file to PDF
document using the Ghost Script. The problem i am facing is that the GS API
is failing to convert the PS to PDF for some specific PS file. I am using
the following code to convert PS to PDF

<code>
gs_main_instance *m_GSInstance=0;
int iRet = 	gsapi_new_instance((void **)&m_GSInstance, NULL);
if (iRet < 0)
    {
        throw new CGSException("Error occurred while initializing GS
Converter.");
        return;
    }

char **pcGSOptions = null;
int nGSOptions = 0;

// Step not shown here is: Preparing the GS Options 

int iRet = gsapi_init_with_args(m_GSInstance, nGSOptions, pcGSOptions);
// At this call i am receiving the Access Voilation at Runtime
if(iRet <= -100)
    {
        gsapi_exit(m_GSInstance);
        throw new CGSException("Unable to generate document.");
    }

gsapi_exit(m_GSInstance);
</code>

The above mentioned code is working fine for all the documents except some,
i am unable to identify where i am doing some this wrong, is there some
issue in how i am using the API or is there something wrong with the
docuemnt. I am attaching the document that is causing the problem.

I am using: http://www.nabble.com/file/p23149435/msw.zip msw.zip 
Ghostscript v8.63
Visual Studio 2005

Kindly guide me where i am doing wrong. Thanking in advance.

Regards,
Ghazanfar
-- 
View this message in context: http://www.nabble.com/Ghostscript-API-Failing-tp23149435p23149435.html
Sent from the Ghostscript - Dev mailing list archive at Nabble.com.



More information about the gs-devel mailing list