xps2pdf as dll library, is there any way to package xps2pdf.exe as an application library (.dll)?

Hi, is there any way to package xps2pdf.exe as an application library (.dll)?

We have experienced several instances where users have antivirus software or other IT policies that quarantine/block xps2pdf.exe.

Thank you in advance!

Customer
--------------------------------------------

image
Thanks for your message, yes, we have a XPS2PDF SDK product, the cost of this XPS2PDF SDK Developer License is USD$2495, it's royalty free, you can purchase it from our website directly,

http://www.verypdf.com/dl2.php/xps2pdf_sdk.zip
https://www.verydoc.com/xps-to-pdf.html
http://www.verypdf.com/order2.php?s=102518&p=xpstopdfsdkdev&q=1&v=0&d=0

VeryDOC
--------------------------------------------
Thank you for this information.

Can you clarify what royalty free indicates?

Additionally, does the SDK product indicate that we obtain the source code and/or repository?

Customer
--------------------------------------------
>>Can you clarify what royalty free indicates?

Royalty free is mean that you need only pay one time, the cost is USD$2495, you needn't pay it every year, it's just one time fee.

>>Additionally, does the SDK product indicate that we obtain the source code and/or repository?

Thanks for your message, we don't provide the source code for the SDK product, we are provide only the DLL libraries.

VeryDOC
--------------------------------------------
Thanks for the clarification with my prior questions.

We are interested in purchasing the SDK if we can apply our prior purchase of the "1 Developer License" towards this purchase. Can this be done? We weren't aware of the SDK offering when we first made our purchase and can not purchase a new license. I hope this is something your team can understand.

Let me know, and thank you in advance,
Customer
--------------------------------------------
Thanks for your message, you can pay price difference to upgrade from XPS to PDF Converter Command Line Developer License to SDK Developer License, that's no problem.

VeryDOC
--------------------------------------------
Thanks for this answer.

Can you tell me what files are provided in the SDK? For instance, is it a native windows dll, or a .NET dll. If it is a .NET dll, what version of .NET does it target? Also are there any other files or code samples, and if so in which language are the code samples?

I’m asking because there isn’t a trial and I need to be sure we can incorporate it.

Thanks again,
Customer
--------------------------------------------
>>Can you tell me what files are provided in the SDK? For instance, is it a native windows dll, or a .NET dll. If it is a .NET dll, what version of .NET does it target?

Thanks for your message, the XPS to PDF Converter SDK contains following files,

1. xps2pdf.dll library,
2. xps2pdf.lib file, this is an interface file for xps2pdf.dll library,
3. xps2pdfcom.exe file, this is the COM interface file for xps2pdf.dll library, this COM can be called from both 32bit and 64bit systems.
4. C++, VB, C#, VB.NET, PHP, etc. demo projects.

The DLL is a native Windows DLL, it's not a .NET DLL.

>>Also are there any other files or code samples, and if so in which language are the code samples?

Yes, the SDK contains C++, VB, C#, VB.NET, PHP, etc. demo projects, you can compile and run these sample projects easily.

If you have any question, please feel free to let us know, we will assist you asap.
VeryDOC
--------------------------------------------
Thanks for these answers.

Our project is a c# application, and we are looking to remove all *.exe dependencies.

Can you confirm that we could simply include the *.dll and potentially *.lib file into our project without the need for the xps2pdfcom.exe? Can you also tell me if the C# sample provided works without xps2pdfcom.exe?

Thanks again!
Customer
--------------------------------------------
Yes, of course, you can simply include *.dll files into your project and without the need for the xps2pdfcom.exe, that's no problem.

Yes, you can call xps2pdf.dll library from C# project directly and without xps2pdfcom.exe.

You can download XPS to PDF Converter SDK from this URL,

http://www.verypdf.com/dl2.php/xps2pdf_sdk.zip

Please set your license key into the source code to remove the restrictions, for example,

+++++++++++++++++
private void button1_Click(object sender, EventArgs e)
{
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
string strPDFFile = appPath + "\\sample\\test.xps";
string strOutFile = appPath + "\\_out_C#.pdf";
string strLicenseKey = "XXXXXXXXXXXXXXXXX";

string strCmd = "-$ " + strLicenseKey + " \"" + strPDFFile + "\" \"" + strOutFile + "\"";

System.Type VeryPDFType = System.Type.GetTypeFromProgID("VeryPDF.XPStoPDFCom");
VeryPDF.XPStoPDFCom VeryPDFCom = (VeryPDF.XPStoPDFCom)System.Activator.CreateInstance(VeryPDFType);
int nReturn = VeryPDFCom.XPStoPDF(strLicenseKey, strCmd);
MessageBox.Show("Converter finished.");
}
+++++++++++++++++

You can also call xps2pdfsdk.dll from your C++ source code directly, for example,

+++++++++++++++++
typedef int (__stdcall *VeryPDFXPS2PDFConverterFunc)(const char *lpszCmdLine);
typedef void (__stdcall *VeryPDFXPS2PDFSetCodeFunc)(const char *lpRegcode);
VeryPDFXPS2PDFConverterFunc lpVeryPDFXPS2PDFConverter = NULL;
VeryPDFXPS2PDFSetCodeFunc lpVeryPDFXPS2PDFSetCode = NULL;
BOOL XPS2PDFConverterSDK(const char *lpszLicenseKey, const char *lpszCmdLine)
{
if(lpszCmdLine == NULL || lpszCmdLine[0] == 0)
        return FALSE;

char szPath[_MAX_PATH];
GetModulePath(szPath,"xps2pdfsdk.dll");
HINSTANCE hXPS2PDFSDK = LoadLibrary(szPath);
if(hXPS2PDFSDK == NULL)
        return FALSE;

lpVeryPDFXPS2PDFConverter = (VeryPDFXPS2PDFConverterFunc)GetProcAddress(hXPS2PDFSDK, "VeryPDFXPS2PDFConverter");
if(lpVeryPDFXPS2PDFConverter == NULL)
        return FALSE;

lpVeryPDFXPS2PDFSetCode =(VeryPDFXPS2PDFSetCodeFunc)GetProcAddress(hXPS2PDFSDK, "VeryPDFXPS2PDFSetCode");
if(lpVeryPDFXPS2PDFSetCode ==NULL)
        return FALSE;

if(lpszLicenseKey && lpszLicenseKey[0] != 0)
        lpVeryPDFXPS2PDFSetCode(lpszLicenseKey);
int nResult = lpVeryPDFXPS2PDFConverter(lpszCmdLine);
FreeLibrary(hXPS2PDFSDK);
        return nResult;
}

XPS2PDFConverterSDK("XXXXXXXXXXXXXXXXX", "-$ XXXXXXXXXXXXXXXXX D:\test.xps D:\out.pdf");
+++++++++++++++++

If you encounter any problem with XPS to PDF Converter SDK, please feel free to let us know, we are glad to assist you asap.

VeryDOC
--------------------------------------------
Could you create an example c# console app (.NET 4.5+) that does not rely on the COM.exe?

None of the examples build or run for me, and I believe the above code is a c++ example.

Thanks in advance,
Customer
--------------------------------------------
Thanks for your message, we have created a new example C# console app (.NET 4.5+) that does not rely on the COM.exe for you, please download the new package from this URL,

http://www.verypdf.com/dl2.php/xps2pdf_sdk.zip

after you download and unzip it to a folder, please go to following folder,

xps2pdf_sdk\example_C#\WindowsFormsApplication_DLL

this C# example will let you know how to call xps2pdfsdk.dll directly and without depend on COM.exe, here is the sample source code,
+++++++++++++++++
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 System.Runtime.InteropServices;
using System.IO;

namespace WindowsFormsApplication_DLL
{
public partial class Form1 : Form
{
[DllImport(@"xps2pdfsdk.dll", CharSet = CharSet.Auto)]
public static extern int VeryPDFXPS2PDFConverter(
[MarshalAs(UnmanagedType.LPStr)] string strCommandLine);

[DllImport(@"xps2pdfsdk.dll", CharSet = CharSet.Ansi)]
public static extern void VeryPDFXPS2PDFSetCode(
[MarshalAs(UnmanagedType.LPStr)] string strLicenseKey);

public Form1()
{
        InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
string strPDFFile = appPath + "\\sample\\test.xps";
string strOutFile = appPath + "\\_out_C#_dll.pdf";
string strLicenseKey = "XXXXXXXXXXXXXXXXX";

string strCmd = "-$ " + strLicenseKey + " \"" + strPDFFile + "\" \"" + strOutFile + "\"";
VeryPDFXPS2PDFSetCode(strLicenseKey);
int nRet = VeryPDFXPS2PDFConverter(strCmd);
}
}
}
+++++++++++++++++

If you encounter any problem with the new package, please feel free to let us know, thank you.
VeryDOC
--------------------------------------------
Thank you for the updated example, I am making some progress integrating this. I have two questions below:

1. Can you tell me which of the following dlls are required:
- cximagecrt.dll (required)
- msvcr71.dll (is this required?)
- tiffcp.dll (is this required?)
- xps2pdf.dll (required)
- xps2pdfsdk.dll (required)
- xpssdk.dll (is this required?)
- zlib.dll (is this required?)

2. In addition, is the "-linearize" parameter supported? I know it wasn't supported in prior version.

Thanks again!
Customer
--------------------------------------------
Also, can you tell me what the various return codes are (int nRet) in your example above?

Customer
--------------------------------------------
>>Thank you for the updated example, I am making some progress integrating this. I have two questions below:
>>1. Can you tell me which of the following dlls are required:

- cximagecrt.dll (required): yes, required.
- msvcr71.dll (is this required?): if your system has already installed msvcr71, this DLL is not necessary.
- tiffcp.dll (is this required?): This is for TIFF image processing only, if you need only convert from XPS to PDF file, this DLL is not necessary.
- xps2pdf.dll (required): yes, required.
- xps2pdfsdk.dll (required): yes, required.
- xpssdk.dll (is this required?): This DLL is for "-useprinter" option, if you don't use "-useprinter" option, you can delete this DLL file.
- zlib.dll (is this required?): yes, this DLL is used to decompress XPS file to memory, it's required.

>>2. In addition, is the "-linearize" parameter supported? I know it wasn't supported in prior version.

Thanks for your message, "-linearize" parameter is not supported in the current version, we will try to support this option in the future.

>>Also, can you tell me what the various return codes are (int nRet) in your example above?

VeryPDFXPS2PDFConverter() function 1 is indicate conversion successful, 0 is conversion fail, if you are fail to convert a XPS file to PDF file, please feel free send to us that XPS file, we will analyze that XPS file and come back to you asap.

VeryDOC
--------------------------------------------
Thank you for the prompt responses - what is the -useprinter option?

Is there a full list of all of the options available aside from the "readme.txt"?

Customer
--------------------------------------------
>>Thank you for the prompt responses - what is the -useprinter option?

"-useprinter" option will install a Virtual Postscript Printer into your system first, print XPS file to this Virtual Postscript Printer to create PS file, and then convert from PS file to PDF file again. The XPS Printing method will maintain everything no difference between XPS and generated PDF file, so you can use this option to convert some XPS files which not supported very well by direct conversion method.

>>Is there a full list of all of the options available aside from the "readme.txt"?

Thanks for your message, we haven't a another document yet, however, if you encounter any problem with XPS to PDF Converter software, please feel free to let me know, we are glad to provide more information to you asap.

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

This entry was posted in XPS to PDF And Image Converter and tagged . Bookmark the permalink.

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!