Re:
Posted: Wed Jun 15, 2011 11:04 am
Maybe I can do it.Marco2007 wrote:![]()
Anyone else?
http://www.purebasic.com
https://www.purebasic.fr/english/
Maybe I can do it.Marco2007 wrote:![]()
Anyone else?
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
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.