Use PDF2TXT SDK in VB.NET

I downloaded Trail version of PDF2TXT and trying to use it in our VB.Net web application. I am getting errors. Even if I try to run sample code for “pdf2txt_c#2” getting error where license is specified.

I would really appreciate if you can provide some information how to use PDF2TXT in VB.Net application with VS 2010. I would really appreciate it.
=================================
Can you please let us know what error message did you encounter? Can you please email to us your Order ID? After we received your Order ID, we will provide more assistance to you asap.

VeryPDF
=================================
I am trying to evaluate software(s) so we can make decision of which product to purchase. I am getting " Unable to load DLL 'pdf2txt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)" error while running C# example.

Also I am not able to find VB.Net web application example so if you can provide me with that then I would really appreciate it.

=================================
>>I am trying to evaluate software(s) so we can make decision of which
>>product to purchase. I am getting " Unable to load DLL 'pdf2txt.dll':
>>The specified module could not be found. (Exception from HRESULT: 0x8007007E)" error while running C# example.

For the C# example, please copy compiled WindowsFormsApplication1.exe and following DLL files to same folder,

encryptpdf.dll
pdf2txt.dll
pdfsdk.dll

run your WindowsFormsApplication1.exe from this folder, then WindowsFormsApplication1.exe will able to load pdf2txt.dll properly.


>>Also I am not able to find VB.Net web application example so if you can provide me with that then I would really appreciate it.

Please download a VB.NET project from following URL,

XXXXXXXXXXXXXXX

you need also copy compiled VB.NET exe and following DLL files into same folder, then you can run your EXE properly,

encryptpdf.dll
pdf2txt.dll
pdfsdk.dll

VeryPDF
=================================
I downloaded VB.Net code and when I run directly from visual studio, I am getting some error but when I run exe from bin folder it's working fine.

As I mentioned earlier, my requirement is to incorporate this into my web based application. I tried copying same code into web base vb.net application and I am getting " Unable to load DLL 'pdf2txt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)Object reference not set to an instance of an object" error. I have copied all three dll's you mentioned in my web project root folder as well as bin folder.

Can you please help me speed up this process so I can make my decision of buying veryPDF or not? Incase you need to reach me then my contact number is XXXXXXXXX

=================================
Yes, you need run it from "bin" folder, if you run it from visual studio, your EXE can't load necessary DLL files properly.

Please copy all DLL files (encryptpdf.dll, pdf2txt.dll, pdfsdk.dll) to system32 folder, then you can run your VB.NET application properly, please to try.

VeryPDF
=================================
My error got resolved after copying DLL’s to system32 folder on my test Windows XP machine with Visual Studio 2008 web based application.

When I tried same on my actual development machine which has Windows 7 and Visual Studio 2010, even after following same process I am getting “Unable to load DLL 'pdf2txt.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)” error. Can you please help?

As I mentioned earlier we have already purchased one of veryPDF product for stamping and you have provided us with 64 bit version. Can you please let me pricing involved with PDF2TEXT for same kind of version?
=================================
On the 64bit system, please copy all DLL files to syswow64 folder instead of system32 folder, also, you need compile your project with x86 platform format, then you can call PDF2TXT from your code properly.

If you wish call PDF2TXT SDK from 64bit EXE code directly, we can provide a 64bit COM interface to you at USD1200, if you are interest in this 64bit COM interface, please feel free to let us know, we will prepare an purchase web page to you shortly.

VeryPDF
=================================
I copied DLL into syswow64 folder and now I am getting different error “A call to PInvoke function 'App_Web_ija241d1!EDocsJumper::PDF2TXTEx' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.” If I bypass this error then it’s working.

Before we purchase PDF2TXT, we would like to test it on 64bit system to make sure that there are no surprises. Is it possible for you to send me demo version of 64 bit so we can run it and test it? Also we are interested in looking at full file conversion and how it look? Is it possible to send me some examples of simple to complex PDF conversion? I saw one example in site but need to look at few more.
=================================
We have created a new test package for you, please download it from following URL,

XXXXXXXXXXXXXXX

after you unzip it to a folder, please run “register_pdf2txtcom.bat” to register PDF2TXTCOM.exe, then you can run “test_win64.vbs” to convert PDF file to text file.

PDF2TXTCOM.exe can be called from both 32bit and 64bit application, please refer to following sample code,

~~~~~~~~~~~~~~~~~
Dim oTest
dim nRet

Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(wscript.ScriptFullName)
destiantionPath = strFolder & "\verypdf.pdf"

Set oTest = CreateObject("PDF2TXTCOM.PDF2TXT")
oTest.com_SetTXTFormat 1
oTest.com_SetZoomRatio 90
oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXXXXXXXXX")
nRet = oTest.com_Pdf2Txt(strFolder & "\sample1.pdf", strFolder & "\sample1-pdf2txt.txt")
nRet = oTest.com_Pdf2TxtEx(strFolder & "\sample1.pdf", strFolder & "\sample1-pdf2txtEx.txt",0,0,"","")
MsgBox "Convert Success!"
~~~~~~~~~~~~~~~~~

VeryPDF
=================================
This worked. Thank you.

Is there a documentation that can explain what SetTxFormat, SetZoonRatio does, what are other properties/events and what is difference between Pdf2Txt & Pdf2TxtEx methods?

Also we are interested in looking at full file conversion and how it look? Is it possible to send me some examples of simple to complex PDF conversion? I saw one example in site but need to look at few more.

=================================
SetTxFormat, SetZoonRatio functions are work in old versions only, in the latest version of PDF2TXT SDK product, Pdf2Txt & Pdf2TxtEx methods are process Text Format and ZoomRatio automatically, so you can simple ignore SetTxFormat, SetZoonRatio functions in the latest version of PDF2TXT SDK product.

PDF2TXT SDK can be used easily, you need only use following sample code to convert your PDF file to text file,

Set oTest = CreateObject("PDF2TXTCOM.PDF2TXT")
oTest.com_SetTXTFormat 1
oTest.com_SetZoomRatio 90
oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXXXXXXXXX")
nRet = oTest.com_Pdf2Txt(strFolder & "\sample1.pdf", strFolder & "\sample1-pdf2txt.txt")
nRet = oTest.com_Pdf2TxtEx(strFolder & "\sample1.pdf", strFolder & "\sample1-pdf2txtEx.txt",0,0,"","")

above code can be called from both 32bit and 64bit application, if you encounter any problem with above code, please email to us your sample PDF file for checking, after we checked your sample PDF file, we will figure out a solution to you asap.

VeryPDF
=================================
-----------------------------------------------------------------------------
------------------------------Code 1-----------------------------------
-----------------------------------------------------------------------------
I am trying to execute below code on my win 7 machine on ASP. Net application than getting "Cannot create ActiveX component." error.

Dim oTest As Object
Dim nRet As Object

Dim fso = CreateObject("Scripting.FileSystemObject")
oTest = CreateObject("PDF2TXTCOM.PDF2TXT")
oTest.com_SetTXTFormat(1)
oTest.com_SetZoomRatio(90)
oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXXXXXXXXX")
nRet = oTest.com_Pdf2Txt(PDFFilename, TXTFilename) nRet = oTest.com_Pdf2TxtEx(PDFFilename, TXTExFilename, 0, 0, "", "") MsgBox("Convert Success!")

-----------------------------------------------------------------------------
------------------------------Code 1-----------------------------------
-----------------------------------------------------------------------------
If I execute below code, its working fine.

PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXX")
PDF2TXTEx(PDFFilename, TXTFilename, 0, 0, "", "")

-----------------------------------------------------------------------------
---------------------------------Help-------------------------------------
-----------------------------------------------------------------------------
Which code we should use in our application? Also for deploying this into testing, I am sending below steps to my admin, is there all we have to do or add something?

Steps for PDF2Text Deployment:
-------------------------------------------------
1)      Download project from XXXXXXXXXXXXXXX
2)      Unzip it and run “register_pdf2txtcom.bat” to register PDF2TXTCOM.exe
3)      Copy all DLL files (encryptpdf.dll, pdf2txt.dll, pdfsdk.dll) to syswow64 folder

Once this testing is approved by users, we will able to make final purchase.

=================================
Have you registered PDF2TXTCOM.exe? if not, please use administrator right to run following command line to register it,

PDF2TXTCOM.exe /regserver

If you are run ASP.NET on 64bit system, please notice an important matter, PDF2TXTCOM.exe is a 32bit COM, so you need run your ASP application in 32bit mode or x86 platform, then your ASP code can access the 32bit pdfout.dll properly. If your ASP application run at x64 platform mode, it can’t access to the 32bit PDF2TXTCOM.exe, please notice this matter.

We suggest you may by following steps to "Enable 32-bit Applications" for IIS service,

1. Create a new application pool for the helpdesk application.
2. In the new pool's advanced settings, set "Enable 32-bit Applications" to true.
3. Right-click the helpdesk application's virtual directory in IIS manager, make sure it has been converted to application. This makes it be a separate web application which is independent to the parent site.
4. In the virtual directory's Basic settings, change it to use the new application pool.

You can also change the settings to your original Application Pool, please go to the Application Pool tied to the web application, Advanced Properties... and setting "Enable 32-bit Applications" to True, then your ASP code can call 32bit PDF2TXTCOM.exe correctly.

You can also refer to more information from following web pages,

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true

http://www.eggheadcafe.com/software/aspnet/33931176/iis-7-running-32-bit-app-in-64bit-server.aspx


Code 1 is work for ASP and ASP.NET application, code 2 is work for VB, VC++, Delphi, etc. language, it is depend on what language that you want call PDF2TXT SDK from.


I have re-test this package in my system just now, everything is fine.

If you encounter any other problem, you may contact me by skype or MSN, I will assist you online asap.

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

I followed below steps to deploy PDF2TEXT on staging server (Windows 2008 - 64 Bit) and we are using below code to convert PDF2Text but getting "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" error. Same code is working on my local development machine (Windows 7 - 64 Bit)

-------------------------------------------------------------------
Steps for deploying PDF2TEXT on Server
-------------------------------------------------------------------
1) Download project from XXXXXXXXXXXXXXX
2) Unzip it and run “register_pdf2txtcom.bat” to register PDF2TXTCOM.exe
3) Copy all DLL files (encryptpdf.dll, pdf2txt.dll, pdfsdk.dll) to syswow64 folder

-------------------------------------------------------------------
Code for Converting PDF2Text
-------------------------------------------------------------------
PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXX")
PDF2TXTEx(PDFFilename, TXTFilename, 0, 0, "", "")


-------------------------------------------------------------------------------------------------
I TRIED BELOW CODE TOO BUT ITS JUST KEEP PROCESSING
-------------------------------------------------------------------------------------------------
Dim oTest As Object
Dim nRet As Object

Dim fso = CreateObject("Scripting.FileSystemObject")
oTest = CreateObject("PDF2TXTCOM.PDF2TXT")
oTest.com_SetTXTFormat(1)
oTest.com_SetZoomRatio(90)
oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXX") 'XXXXXXXXXXXXXXXXXXXXXX
nRet = oTest.com_Pdf2Txt(PDFFilename, TXTFilename)
=============================================
Yes, you are right, you can't call PDF2TXT.dll from 64bit application directly, you have to use PDF2TXTCOM.exe COM interface, so the following code will work fine to you,

~~~~~~~~~~
Dim oTest As Object
Dim nRet As Object

Dim fso = CreateObject("Scripting.FileSystemObject")
oTest = CreateObject("PDF2TXTCOM.PDF2TXT")
oTest.com_SetTXTFormat(1)
oTest.com_SetZoomRatio(90)
oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXX") 'XXXXXXXXXXXXXXXXXXXXXX
nRet = oTest.com_Pdf2Txt(PDFFilename, TXTFilename)
~~~~~~~~~~

Please notice, the trial version of PDF2TXTCOM.exe does popup a message box, this message box may block the ASP.NET application, after you purchased it, this message box will be removed, then your ASP.NET application will work properly, please notice this matter.

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

One Reply to “Use PDF2TXT SDK in VB.NET”

  1. Please give full control permission to Everyone to “PDF2TXTCOM.PDF2TXT” DCOM, so that you will able to call “PDF2TXTCOM.PDF2TXT” from classic ASP code, please look at following web page to study how to give full control permission to “PDF2TXTCOM.PDF2TXT” DCOM,

    http://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.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!