Using pdf2txt in Delphi2010, Unicode to Ansi

We've been using the pdf2txt.dll in our program that was build using Delphi6. We are now upgrading our programming environment to Delphi2010.
In Delphi2010 it doesn’t work anymore. I don’t get any errors but the Pdf2TxtEx function doesn’t create an output text file anymore. Only file created is file named ‘C’ (no extension) that when opened in notepad shows the text that we are using a trial version.  But we do use the PDF2TXTSetLicenseCode function with a license key (which works in Delpdi 6).
Is it possible to use pdf2txt in Delphi2010? How can I accomplish that?
========================
Maybe your Delphi2010 is using Unicode, please change the compile type from Unicode to ANSI to try again, you will get it work with ANSI compile type.

VeryPDF
========================
Our Delphi 2010 environment is using Unicode, that was the intention. After some trying I found the way to get it to work.
This works in our case:
//declaration
procedure PDF2TXTSetLicenseCode(lpRegCode: PAnsiChar); stdcall; external 'pdf2txt.dll' name 'PDF2TXTSetLicenseCode';
//implementation
PDF2TXTSetLicenseCode(PAnsiChar(AnsiString('yourlicensecode'));
======================
This is a great solution, your great solution will helpful for our other customers in the future, thank you again.

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 Text 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!