How to convert from PDF to text in memory completely?

Hi,

We are planning to buy the license for our project to convert the PDF to Text File using pdf2txt.dll.

When trying to check the usage, we wanted to create a class in VS 2015 and use the DllImport function to use the functions of the above dll.

But we are getting error like,

"An unhandled exception of type 'System.DllNotFoundException' occurred in dll"

We need support to resolve the above issue to use the dll to convert PDF File to text file.

Thanks,
Customer
----------------------------------------

image
Please compile your VS2015 project into an EXE file with "x86 platform" option first, place this generated EXE and following DLL files into the same folder,

encryptpdf.dll
pdf2txt.dll
pdfsdk.dll

and run your EXE to try again, your EXE will able to load pdf2txt.dll library properly.

If you still can't get it work, please send to us your demo project, we will test your demo project and provide a solution to you asap.

VeryPDF
----------------------------------------
Hi,

Thanks for the update.

The Class developed in VS 2015 DLL using pdf2txt.dll is working when checking with another Exe application by referring the dll of the class module.

We wanted to use the class module in SSIS Package inside script task to convert the pdf into text file and extract data from text file and push into SQL.

The class module DLL is registered with strong name in the machine where SSIS Package is tested.

We are getting the message like attached image when using Convert Function from Class Module which is calling the method of pdf2txt.dll file.

Attached the class module which is using the pdf2txt.dll to convert PDF to Text File.

In Addition, I need to know is there any option to store the output as text stream instead of File so that it will be great when creating file permission is not available in the folder.

All the dll files are available in local folder as well as in bin folder.

Need your assistance in this regard asap.

Thanks,
Customer
----------------------------------------
You can use the following functions to convert from PDF from memory or disk file to a text data in memory,

PDF2TextBuffer
PDF2TextBufferW
PDF2TextBufferWEx
PDFBuffer2TextBuffer
PDFBuffer2TextBufferW
PDFBuffer2TextBufferWEx
PDF2TextFreeBuffer
PDF2TextFreeBufferW

please refer to the description for these functions at below,

//////////////////////////////////////////////
//9.const char* PDF2TextBuffer(LPCTSTR pdfFile, int *textBufferSize)
//Description:
// Convert a pdf file to a text buffer.
//
//Parameters:
// pdfFile : input pdf filename
// textBufferSize : the size of the return buffer
//
//Return value:
// Point to a text buffer, after you used it, you need use PDF2TextFreeBuffer function to free it.
//////////////////////////////////////////////
EXTERN
const char* __stdcall PDF2TextBuffer(LPSTR pdfFile, int *textBufferSize);

EXTERN
LPCWSTR __stdcall PDF2TextBufferW(LPCWSTR pdfFile, int *textBufferSize);

EXTERN
LPCWSTR __stdcall PDF2TextBufferWEx(LPSTR pdfFile, int *textBufferSize,
int iFirstPage,int iLastPage, LPCTSTR ownerPWD,LPCTSTR userPWD,
LPSTR textEncName, int noPageBreaks);
//////////////////////////////////////////////
//10.const char* PDFBuffer2TextBuffer(const char* pdfBuffer, int pdfBufferSize,int *textBufferSize)
//Description:
// Convert a pdf buffer to a text buffer.
//
//Parameters:
// pdfBuffer : the pdf file contents
// pdfBufferSize : the size of the pdfBuffer
// textBufferSize : the size of the return buffer
//
//Return value:
// Point to a text buffer, after you used it, please use PDF2TextFreeBuffer function to free it.
//////////////////////////////////////////////
EXTERN
const char* __stdcall PDFBuffer2TextBuffer(const char* pdfBuffer, int pdfBufferSize,int *textBufferSize);

EXTERN
LPCWSTR __stdcall PDFBuffer2TextBufferW(const char* pdfBuffer, int pdfBufferSize,int *textBufferSize);

EXTERN
LPCWSTR __stdcall PDFBuffer2TextBufferWEx(const char* pdfBuffer, int pdfBufferSize,int *textBufferSize, int iFirstPage,int iLastPage, LPCTSTR ownerPWD,LPCTSTR userPWD, LPSTR textEncName, int noPageBreaks);
//////////////////////////////////////////////
//11.void PDF2TextFreeBuffer(const char* textBuffer)
//Description:
// Free the text buffer
//
//Parameters:
// textBuffer : this parameter is returned by PDF2TextBuffer and PDFBuffer2TextBuffer functions
//
//Return value:
// none.
//////////////////////////////////////////////
EXTERN
void __stdcall PDF2TextFreeBuffer(const char* textBuffer);

EXTERN
void __stdcall PDF2TextFreeBufferW(LPCWSTR textBuffer);

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

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!