How to Call PDF2TXT SDK DLL Library from a 64-bit Application?

Many developers face compatibility issues when transitioning from 32-bit to 64-bit applications, especially when working with older versions of libraries and SDKs. One such case involves the PDF2TXT SDK, which was originally designed to run in a 32-bit environment. However, modern software development often necessitates the use of 64-bit applications. Fortunately, the PDF2TXT DLL Library is fully compatible with 64-bit programs. This article will guide you through the process of calling the PDF2TXT SDK DLL from a 64-bit application, ensuring smooth and efficient integration.

https://www.verypdf.com/app/pdf-to-txt-converter/try-and-buy.html

How to Call PDF2TXT SDK DLL Library from a 64-bit Application?

Compatibility

Question:

I have an older version of PDF2TXT that won't run in a 64-bit Delphi program, only 32-bit. I just wanted to make sure your DLL will run fine when called from a 64-bit program.

Answer:

Thanks for your message. Yes, the PDF2TXT DLL Library can be called from a 64-bit program without any issues.

For more detailed information, please refer to the following web page:
[How to Call PDF to Text Converter SDK/COM from Both 32-bit and 64-bit Applications]

https://www.verypdf.com/wordpress/201407/how-to-call-pdf-to-text-converter-sdkcom-from-both-32bit-and-64bit-applications-how-to-use-pdf2txtcom-exe-com-interface-40810.html

Steps to Use PDF2TXT COM from Both 32-bit and 64-bit Applications

The PDF2TXT SDK package includes a file named `PDF2TXTCOM.exe`. Follow these steps to use the PDF2TXT COM component from both 32-bit and 64-bit applications:

1. Register PDF2TXTCOM.exe

To register the `PDF2TXTCOM.exe` into your system, you need to run the following command line with administrator privileges:

```sh

PDF2TXTCOM.exe /regserver

```

2. Call PDF2TXTCOM.exe from a 64-bit Application Using VBScript

You can use the following VBScript (VBS) to call `PDF2TXTCOM.exe` from your 64-bit application. This script demonstrates how to set various options and convert a PDF to text.

VBScript Example

```vb
Dim oTest
Dim nRet

Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(wscript.ScriptFullName)
destinationPath = 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!"
```

Explanation

1. Create Object: The script creates an instance of the PDF2TXTCOM object.
2. Set Options: It sets various options such as the text format and zoom ratio.
3. Set License Code: You need to set the license code for the PDF2TXT component.
4. Convert PDF: The script converts the PDF to a text file using two different methods (`com_Pdf2Txt` and `com_Pdf2TxtEx`).
5. Success Message: Upon successful conversion, a message box is displayed.

Conclusion

By following the steps outlined above, you can successfully call the PDF2TXT DLL Library from a 64-bit application. Registering the `PDF2TXTCOM.exe` and using VBScript to interface with the COM component ensures compatibility and allows for seamless PDF to text conversion in your applications. If you encounter any issues or need further assistance, please do not hesitate to contact our support team.

Related Posts