pdf2image DLL Library on x64 system

Thank you very much for your prompt reply. I wish that the support from all of the products we use was as good.

However, as long as I was working with it, I tested it on a 64 bit machine (one of my workstations, which is Windows 7 Professional  x64). This simple code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace TestPDF2Image2
{
class Program
{
private const string PDF2ImagePathName = @"C:\bin\pdf2image.dll";

[DllImport(PDF2ImagePathName, CharSet = CharSet.Auto)]
static extern uint PDFToImageConverter(
[MarshalAs(UnmanagedType.LPStr)] string FileName,
[MarshalAs(UnmanagedType.LPStr)] string OutputName,
IntPtr UserPassword, IntPtr OwnPassword,
int xresolution, int yresolution, int bitcount,
int compression, int quality, int grayscale,
int multipage, int firstPage, int lastPage);

[DllImport(PDF2ImagePathName, CharSet = CharSet.Auto)]
static extern uint PDFToImageConverterEx(
[MarshalAs(UnmanagedType.LPStr)] string FileName,
[MarshalAs(UnmanagedType.LPStr)] string OutputName,
IntPtr UserPassword, IntPtr OwnPassword,
int m_iPageSizeMode, int xresolution, int yresolution, int bitcount,
int compression, int quality, int grayscale,
int multipage, int firstPage, int lastPage);

[DllImport(PDF2ImagePathName, CharSet = CharSet.Ansi)]
static extern uint PDFToImageSetCode(string lpRegcode);

static void Main(string[] args)
{
PDFToImageSetCode("XXXXXXXXXXXXXXXXXX");
}
}
}

Returns this error:

System.BadImageFormatException was unhandled
Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
Source="TestPDF2Image"
StackTrace:
at TestPDF2Image.Program.PDFToImageSetCode(String lpRegcode)
at TestPDF2Image.Program.Main(String[] args) in C:\Custom Libraries\ResultReportsV1\Version 1.0\TestPDF2Image\Program.cs:line 34
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Is PDF2Image compatible with 64 bit Windows? I suspect that the problem is that it is not. This will become an issue since we’re moving all our servers from Windows 2003 x86 to Windows 2008 R2 x64.
==============================================
pdf2image.dll is the 32bit DLL Library, you can compile your application with x86 platform, then you can call pdf2image.dll from your code properly.

Also, the latest version of PDF2Image SDK can be called from 64bit EXE directly, please refer to following web page for more information,

Call PDF To Image Converter COM Component v2.0 from 64bit application

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 PDF to 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!