How to use ps2pdfsdk from 64bit C# application

I bought your Postscript PDF SDK and used it in our 32-bit application. I
now migrated this application to 64-bit and I need a version of your
library that works with 64-bit. I downloaded the latest version of your SDK
and found that you have two ps2pdf libraries (ps2pdf_x86.dll and
ps2pdf_x64.dll). I saw the exported function VeryPDF_PsToPDF in both
libraries but those files don't seem to work. Did the exported function
prototype change since version 2.0.0.1? If true, what is the function
prototype?
What libraries and runtimes (msvcr*.dll) I need in both platforms?

Please advice.
XXXXXXXX
=====================================
Please use administrator privilege to run following command line in CMD window,

ps2pdfcom.exe /regserver

this command line will register ps2pdfcom.exe into your system, after that, you can run following VB script code to call ps2pdfcom to convert PS file to PDF file easily,

---------------------------------------
Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(wscript.ScriptFullName)

strInFile = strFolder & "\test.ps"
strOutFile = strFolder & "\test_vbs.pdf"
strCmd = "ps2pdf -$ XXXXXXXXXXXXX " & strInFile & " " & strOutFile

Set ps2pdfcom = CreateObject("ps2pdfcom.ps2pdf")
ps2pdfcom.com_VeryPDF_PSToPDF strCmd
---------------------------------------

You can port above code to VB.NET, C# etc. program languages easily.

Please feel free to let us know if you need any other assistance.

VeryPDF
=====================================
This answer has nothing to do with my problem. May be you sent it to me by mistake. Did you read my question? Is it not clear enough?

XXXXXXX
=====================================

Sorry for the misunderstanding, if you wish call ps2pdf SDK from pure 64bit source code, you should use ps2pdfcom.exe, ps2pdfcom.exe is a COM interface to ps2pdf.dll library.

ps2pdf_x64.dll is just another DLL library for C++ which call ps2pdfcom.exe internally, so, you can pay attention to ps2pdfcom.exe COM only.

Please launch a CMD window by administrator privilege, (click right button on cmd.exe and select "Run as administrator" menu), run following command line to register ps2pdfcom.exe,

ps2pdfcom.exe /regserver

after that, you can add a reference to ps2pdfcom ("ps2pdfcom.ps2pdf") from C#, VB.NET, ASP.NET etc. program languages, then you can call com_VeryPDF_PSToPDF() function to convert PS files to PDF files easily.

image

VeryPDF
=====================================

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

This entry was posted in Postscript to Text/PDF/Image and tagged , , . Bookmark the permalink.

3 Responses to How to use ps2pdfsdk from 64bit C# application

  1. VeryPDF says:

    Dear Sir/Madam,

    I would like to ask for your help to solve the 64-bit (windows servers 2012) issue of PS to PDF SDK dll problem. We are going to develop a server side windows agent (in exe format) to convert PS file to PDF using VB.Net (.NET Framework 4.0), for some reasons, the windows agent should be complied for x64 platform. However, the downloaded ps2pdfsdk.dll cannot be used by 64-bit application. Please advice. Thank you very much.

    Regards,
    Customer
    --------------------------
    You can call ps2pdfcom.exe COM interface, ps2pdfcom.exe COM interface is based on ps2pdfsdk.dll and provide COM interface for both 32bit and 64bit applications, you can call ps2pdfcom.exe COM from 32bit and 64bit application to convert PS to PDF files easily.

    Please look at following web page for more information,

    http://www.verypdf.com/wordpress/201301/how-to-use-ps2pdfsdk-from-64bit-c-application-34100.html

    VeryPDF

    VN:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.20_1166]
    Rating: 0 (from 0 votes)
  2. VeryPDF says:

    Please refer to a C# source code to call "ps2pdfcom.ps2pdf" at below,

    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.");
    }
    }
    }

    VN:F [1.9.20_1166]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.20_1166]
    Rating: 0 (from 0 votes)
  3. VeryPDF says:

    How to use ps2pdfsdk and ps2pdfcom to convert Postscript, PS and EPS files to PDF files from 64bit C# application?

    http://www.verypdf.com/wordpress/201501/how-to-use-ps2pdfsdk-and-ps2pdfcom-to-convert-postscript-ps-and-eps-files-to-pdf-files-from-64bit-c-application-41215.html

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

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!