I am using "VeryPDF_PSToPDF" API to convert PS (Postscript), EPS to PDF, the return code is -2

Hello,

We have purchased "PS to PDF" VeryDOC developer license and currently testing it from C# application.

The sample app that comes with SDK (C#_Example) works out of box. However, if I use the same application in my test application, which is almost same as "SDK's C#_Example" , I don't see the PDF output. The return code is -2 (and not 0 , which I see in SDK 's sample app).

I didn't find API documentation after downloading SDK (I only see "Readme.txt", which doesn't have information about APIs) .

Can you please let me know what does "-2" return code mean in PS to PDF conversion and how to troubleshoot this issue?

Thanks
Customer
---------------------------------------------------------
I am using "VeryPDF_PSToPDF" API to convert ps to PDF.
The return code is -2.
I installed SDK and don't find API documentation (all I saw there is a readme.txt file, which didn't find relevant for this issue).

The C# sample app that was shipped with SDK works. But, when I run this in my test application, which is almost similar to SDK test app, it doesn't create output with "-2" return code.

Can you please help me to troubleshoot ?

Thanks
Customer
---------------------------------------------------------
We have released a new version of "Postscript to PDF Converter SDK" yesterday, you may download it from following web page to try,

https://www.verydoc.com/ps-to-pdf.html
https://www.verydoc.com/ps2pdfsdk.zip

after you download it, please by following steps to test it in C# application,

1. Please run install.vbs to install "ps2pdfcom.exe" into your system first, "ps2pdfcom.exe" is the COM interface to "ps2pdf.dll" library, "ps2pdfcom.exe" can be called from both 32bit and 64bit applications,

2. You can call "ps2pdfcom.ps2pdf" from C# code to convert from PS file to PDF file, for example,

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ps2pdfcom;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);
            string strInFile = appPath + "\\test.ps";
            string strOutFile = appPath + "\\_test.pdf";
            string strLicenseKey = "-$ XXXX-XXXX-XXXX-XXXX";

            string strCmd = strLicenseKey + " \"" + strInFile + "\" \"" + strOutFile + "\"";

            System.Type VeryPDFType = System.Type.GetTypeFromProgID
                       ("ps2pdfcom.ps2pdf");
            ps2pdfcom.ps2pdf VeryPDFCom = (ps2pdfcom.ps2pdf)
                       System.Activator.CreateInstance(VeryPDFType);
            VeryPDFCom.com_VeryPDF_PSToPDF(strCmd);
            MessageBox.Show("Converter finished.");
        }
    }
}

3. OK, you should no problem to convert from PS file to PDF file now.

If you get an error with VeryPDF_PSToPDF() function, you may use different conversion mode to try again, for example,

VeryPDF_PSToPDF("ps2pdf -$ XXXXXXXXXXXXX -mode 0 D:\test.ps D:\out.pdf");
VeryPDF_PSToPDF("ps2pdf -$ XXXXXXXXXXXXX -mode 1 D:\test.ps D:\out.pdf");
VeryPDF_PSToPDF("ps2pdf -$ XXXXXXXXXXXXX -mode 2 D:\test.ps D:\out.pdf");
VeryPDF_PSToPDF("ps2pdf -$ XXXXXXXXXXXXX -mode 3 D:\test.ps D:\out.pdf");
VeryPDF_PSToPDF("ps2pdf -$ XXXXXXXXXXXXX -mode 4 D:\test.ps D:\out.pdf");

We hope one of modes will work fine to you.

VeryDOC

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!