Convert Image to XPS from ASP/PHP/C#/.NET/… etc.

   When you need to convert large volumes of image files in real-time on server or for developing, maybe you can have a free trial of software VeryDOC Image to XPS Converter, which can be used to be called via an easily integrated COM object (or DLL Library, or Command Line), enabling developers to access the converter via any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc. Using the COM object (or DLL Library, or Command Line), file conversions can be done consecutively or simultaneously.

Step 1. Download Image to XPS Converter

  • When downloading finishes, there will be some zip file. Please extract it to some folder then you can check the elements in it.
  • This software only can work in Window system both 32-bit and 64-bit.

Step 2. Some examples of conversion from Image to XPS

For example, when you need to call this software from C#, please refer to the following snapshot.

Sample code #1 (C# example),
Make use of the PROCESS class available in SYSTEM.DIOGNOSTICS namaspace, use the following piece of code to execute the img2xps.exe file,
~~~~~~~~~~~~~~~~~
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication1
{
    class Program
{
static void Main(string[] args)
{
Process proc = new Process();
proc.StartInfo.FileName = @"C:\\img2xps.exe";
string strArguments = "";
strArguments += " D:\\temp\\sample.tif D:\\temp\\out.xps";
Console.WriteLine(strArguments);
proc.StartInfo.Arguments = @strArguments;
proc.Start();
proc.WaitForExit();
}
}
}

When you need to call this software from ASP, please refer to the following command line template.

Sample code #3 (ASP example),
Please by following steps to call img2xps.exe inside a special user account,
1. Please download and install EXEShell COM Library (freeware) from following URL first,
https://www.verydoc.com/exeshell.html
https://www.verydoc.com/download/exeshell.zip
2. Please use following ASP code to run the conversion inside a special user account,
~~~~~~~~~~~~~~~~~
<%
    Set comEXEShell = Server.CreateObject("exeshell.shell")
    RootPath = Server.MapPath(".") & "\"
    EXEFile = RootPath & "img2xps\img2xps.exe"
    InFile = RootPath & "test.tif"
    OutFile = RootPath & "out.xps"
    strCommandLine = EXEFile & " " & InFile & " " & OutFile
    response.write strCommandLine & "<br>"
    comEXEShell.RunCommandLine "UserName", "Password", strCommandLine
    Set comEXEShell = Nothing
%>
~~~~~~~~~~~~~~~~~
Remark:
You may encounter Error 1314 in some Windows systems when you switch between user accounts, this is caused by permission setting, please refer to the steps in #2 to solve the 1314 Error.

There are too many functions, I can list all of them here. If you need to check more, please visit it on our website. During the using, if you have any question, please contact us as soon as possible.

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!