VB.NET, C# examples for Postscript to Text Converter SDK DLL Library

VeryDOC Postscript to Text Converter SDK does convert Postscript files to text files,

https://www.verydoc.com/ps-to-text.html

https://www.verydoc.com/ps2txt.zip

The following is the VB, VB.NET and C# examples for Postscript to Text Converter SDK  product,

VB example,

----------------------------------------------
Private Declare Function VeryPDF_PSToText Lib "ps2txtsdk.dll" (ByVal strCommandLine As String) As Long

Private Sub ps2txt_Click()
Dim nRet As Long
Dim strCmd As String

strCmd = "ps2txt -$ XXXXXXXXXXXXXXXXXXXXXXXX"
strCmd = strCmd & " C:\test.ps"
strCmd = strCmd & " C:\test.txt"

nRet = VeryPDF_PSToText(strCmd)
MsgBox (Str(nRet))
End Sub
----------------------------------------------

This the VB.NET example,
----------------------------------------------
Public Class Form1

Private Declare Function VeryPDF_PSToText Lib "ps2txtsdk.dll" (ByVal strCommandLine As String) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nRet As Long
Dim strCmd As String
Dim strInPDFFile As String
Dim strOutFile As String

strInPDFFile = Application.StartupPath() & "\test.ps"
strOutFile = Application.StartupPath() & "\vb_net_test.txt"

strCmd = "ps2txt -$ XXXXXXXXXXXXXXXXXXXXXXXX"
strCmd = strCmd & " """ & strInPDFFile & """"
strCmd = strCmd & " """ & strOutFile & """"

MsgBox(strCmd)
nRet = VeryPDF_PSToText(strCmd)
MsgBox(Str(nRet))
End Sub
End Class
----------------------------------------------

This is the C# source code to convert PS file to Text file,
----------------------------------------------
[DllImport("ps2txtsdk.dll")]
internal static extern int VeryPDF_PSToText(string strCommandLine);

private void button1_Click(object sender, EventArgs e)
{
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
string strCmd = string.Empty;
string psFile = appPath + "\\test.ps";
string txtFile = appPath + "\\_out_C#_test.txt";
int nRet;
strCmd = "ps2txt -$ XXXXXXXXXXXXXXXXXXXXXXXX " + "\"" + psFile + "\" " + "\"" + txtFile + "\" ";
MessageBox.Show(strCmd);
nRet = VeryPDF_PSToText(strCmd);
}
----------------------------------------------

If you need any other examples, please feel free to let us know.

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!