Page 10 of 32

Posted: Thu Nov 13, 2008 8:22 pm
by luis
Hi Klaus, you certainly already knows this, but in any case....

Currently the library does a lot of memory allocation without testing for an out of memory condition.

I did modify the code for the images-related routines because I use only that part in my code (I made a purepdf "light" of some kind actually, thanks to the source availability), so it would be probably useless to post a "patch" this time in this thread because all the library in reality would require such a treatment.

Basically, I added some

Code: Select all

        
        pdfError = 99
        pdfErrorMessage$ = "Out of memory."
        vReturn = #False
if the return value of MEM_DataInit() is False.

What do you think ?

Bye and thank you.

Posted: Tue Nov 18, 2008 11:27 pm
by ABBKlaus
Thanks again luis,

changes are in :wink:
- added new error code 17 = out of memory
- fixed ipf_Escape() for special characters like BS TAB LF FF CR ( )
- fixed GetTimeZoneInformation_() thanks to Rescator for his tip
Download for PB4.2 : http://www.purebasicpower.de/downloads/ ... 4_PB42.zip
Download for PB4.30B4 : http://www.purebasicpower.de/downloads/ ... B43X86.zip

Posted: Tue Nov 18, 2008 11:40 pm
by luis
ABBKlaus wrote: - added new error code 17 = out of memory
Wow, great, thank you :-)

Posted: Wed Nov 19, 2008 6:05 am
by KIKI
Hi ABBKLAUS,
Did you plan to use forms with PDF ?
Thanks,

Posted: Fri Dec 12, 2008 8:01 pm
by fsw
There is a bug in this lib, when the second document is created the new orientation is ignored.

Code: Select all

;###############################################
pdf_Create("L","mm",#PDF_PAGE_FORMAT_LETTER)
pdf_AliasNbPages();
pdf_AddPage()
pdf_Save("PageFormat Landscape.pdf")

;###############################################
pdf_Create("P","mm",#PDF_PAGE_FORMAT_LETTER)
pdf_AliasNbPages();
pdf_AddPage()
pdf_Save("PageFormat Portrait.pdf")
Using PB4.3beta5 with the PB4.3PurePDF library.

Thanks for looking into it.
fsw

Posted: Sat Dec 13, 2008 12:21 am
by ABBKlaus
fsw wrote:There is a bug in this lib, when the second document is created the new orientation is ignored.
Thanks i found the bug, it was a missing ClearList(PagesF()).

Its now fixed, you have to redownload :wink:

Posted: Sun Dec 14, 2008 1:17 am
by luis
Hi Klaus, the proc below

Code: Select all

  Procedure.b MEM_DataInit(*aData.MEM_DataStructure, aSize)
  Protected vReturn.b
  Protected vCurSize
  Protected vTmp
  
  ;aSize = (Int(aSize/64000)+1)*64000
  aSize=((aSize/64000)+1)*64000
  
  If *aData\pData = 0
    vCurSize = 0
    *aData\pData = AllocateMemory(aSize)
  Else
    vCurSize = *aData\lCurSize
    vTmp = ReAllocateMemory(*aData\pData, aSize)
    If vTmp <> 0 ; *aData\pData
      *aData\pData = vTmp
    EndIf  
  EndIf
    
  If *aData\pData = 0
    pdfError = 17
    vReturn = #False
  Else  
    *aData\lMaxSize = aSize
    *aData\lCurSize = vCurSize
    vReturn = #True
  EndIf  
  
  ProcedureReturn vReturn
EndProcedure
should be changed this way, I believe

Code: Select all

Procedure.b MEM_DataInit(*aData.MEM_DataStructure, aSize)
  Protected vReturn.b
  Protected vCurSize
  
  ;aSize = (Int(aSize/64000)+1)*64000
  aSize=((aSize/64000)+1)*64000
  
  If *aData\pData = 0
    vCurSize = 0
    *aData\pData = AllocateMemory(aSize)
  Else
    vCurSize = *aData\lCurSize
    *aData\pData = ReAllocateMemory(*aData\pData, aSize)
  EndIf
    
  If *aData\pData = 0
    pdfError = 17 
    vReturn = #False
  Else  
    *aData\lMaxSize = aSize
    *aData\lCurSize = vCurSize
    vReturn = #True
  EndIf  
  
  ProcedureReturn vReturn
EndProcedure

In the original code if the incoming *aData\pData is already allocated (not 0) and Realloc fails, the

Code: Select all

pdfError = 17 
vReturn = #False 
is not executed.

Posted: Tue Dec 16, 2008 8:38 pm
by fsw
ABBKlaus wrote:
fsw wrote:There is a bug in this lib, when the second document is created the new orientation is ignored.
Thanks i found the bug, it was a missing ClearList(PagesF()).

Its now fixed, you have to redownload :wink:
@ Klaus:
It works again.
Thank you very much.

fsw

Posted: Fri Mar 20, 2009 7:17 am
by Tranquil
Howdy Forum!

Ive got a little question regarding PurePDF. Is it possible to include "StringFields" which can be modified IN the PDF File as a form? (Like the StringGadget in PB for example)

Posted: Thu Jun 25, 2009 10:48 pm
by GG
Hi all,

Is PurePDF 4.31 Pb compatible ?

Posted: Mon Jun 29, 2009 12:32 pm
by ABBKlaus
GG wrote:Hi all,

Is PurePDF 4.31 Pb compatible ?
PB 4.31 is only a bugfix release, so yes it should work.

Regards Klaus

Posted: Fri Aug 14, 2009 10:42 pm
by ABBKlaus
Hi all,

i compiled PurePDF with the new PB4.40Beta1 (only to stop errors like 'SYS_AllocateString' :twisted: )

Please download here : http://www.purebasicpower.de/?download= ... B44X86.zip

Regards Klaus

Re: PurePDF Version 2.0

Posted: Fri Feb 26, 2010 5:59 pm
by ABBKlaus
Update : PurePdf version 2.15 for PureBasic 4.4x x86
  • fixed startxref now points at xref
Regards Klaus

Error when compiling with PB 4.50 Beta 2

Posted: Mon Apr 05, 2010 6:33 pm
by KIKI
Problem encountered with PB 450 beta 2 when compiling

POLINK Errror Unresolved external Symbol 'PB_CallFunctionFast'
POLINK Errror Unresolved external Symbol 'PB_CallFunctionFast2'
POLINK Errror Unresolved external Symbol 'Sys_FreeArray'
POLINK Errror Unresolved external Symbol 'Sys_AllocateArray'

Re: PurePDF Version 2.0

Posted: Mon Apr 05, 2010 9:09 pm
by ABBKlaus
Update : PurePdf version 2.15 for PureBasic 4.5x x86

Regards Klaus