Page 2 of 3

Posted: Wed Dec 10, 2008 10:28 pm
by milan1612
No problem Marco, it was fun to refresh my C++ knowledge. Please don't forget that
the major work on this library wasn't done by me but by the original authors of Xpdf.
For all the others here is the link: http://rapidshare.com/files/172190796/pdf2text.zip

Re:

Posted: Wed Jun 15, 2011 10:44 am
by MachineCode
milan1612 wrote:For all the others here is the link: http://rapidshare.com/files/172190796/pdf2text.zip
Anyone got this pdftext.zip file? This link is 404.

Re: Re:

Posted: Wed Jun 15, 2011 11:02 am
by Little John
MachineCode wrote:Anyone got this pdftext.zip file?
Yes. :)

And many thanks to Milan!

Regards, Little John

Re:

Posted: Wed Jun 15, 2011 11:04 am
by IceSoft
Marco2007 wrote::(

Anyone else?
Maybe I can do it.

Re: Re:

Posted: Wed Jun 15, 2011 12:06 pm
by MachineCode
Thanks, LJ. :)

Re: Make a lib (from C-Code) and get Esgrid!

Posted: Tue Mar 20, 2012 5:00 pm
by Shardik
milan1612's pdf2text.zip contains the following code example:

Code: Select all

Prototype.l ExtractPDFTextProto(PdfFile.s, OutputFile.s)
If OpenLibrary(0, "pdf2text.dll")
  Global ExtractPDFText.ExtractPDFTextProto = GetFunction(0, "ExtractPdfText")
Else
  End
EndIf

If Not ExtractPDFText("c:\LTB2658_1.pdf", "c:\LTB2658_1.txt")
  MessageRequester("Error", "Could not extract pdf text!")
EndIf
Although this code example works it contains a nasty bug which
you will experience if you put the ExtractPdfText function into a
procedure: you will see a crash in the procedure because you have
to use PrototypeC instead of Prototype... :wink:

For an explanation take a look into the PureBasic blog:
freak wrote:Here we get to the reason why it works outside of a procedure and not inside. A call to a procedure stores the address where execution continues after the procedure on the stack as well. If a function call inside the procedure leaves the stack in a mess, then the ProcedureReturn cannot find the address to continue and uses a wrong value instead which leads to a crash. Outside of a procedure, nobody will notice the stack mess, as the stack is only used for function calls.