PurePDF Version 2.0

Developed or developing a new product in PureBasic? Tell the world about it.
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

Is it possible to use Purepdf on X64 computer ? If yes how can i do ?
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Just use the XIncludeFile method. Some examples already have it on top but commented out.

Code: Select all

#PurePDF_Include=1
XIncludeFile "PurePDF.pb"
http://www.purebasicpower.de/downloads/ ... Actions.pb
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

ABBKlaus wrote:Just use the XIncludeFile method. Some examples already have it on top but commented out.

Code: Select all

#PurePDF_Include=1
XIncludeFile "PurePDF.pb"
http://www.purebasicpower.de/downloads/ ... Actions.pb
On X64
on compiling
---------------------------
PureBasic
---------------------------
Polink error unresolve external symbol "_compress"
Last edited by loulou25223 on Tue Feb 04, 2014 9:49 pm, edited 1 time in total.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

What Version are you using ?

Code: Select all

Debug #PDF_VER ; should read 2.24
[Edit]Tutorial05 Compressed.pb corrected :

Code: Select all

ImportC #ZLIB_IMPORT_PATH
  CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
    _compress.l(*dest, *destlen, *source, sourcelen) As "_compress"
  CompilerElse
    _compress.l(*dest, *destlen, *source, sourcelen) As "compress"
  CompilerEndIf
EndImport
loulou25223 wrote:On X64
on this ligne
---------------------------
PureBasic
---------------------------
Procedure.l PDFCompress(*aData.MEM_DataStructure)

Ligne 16: Structure introuvable: MEM_DataStructure.
How can i solve these problem ?
The Structure is present in PurePDF_res.pb which gets XIncluded in PurePDF.pb, but only if you are using the correct Version. Otherwise i have no clue why you are getting this error :?
[/Edit]
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

Thanks that works good now
Have a nice even ing
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

I have a problem with compressed
When i use it the programm fall down on this instruction :

Code: Select all

Procedure.l PDFCompress(*aData.MEM_DataStructure)
 Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
  
 lbError = #False
 SourceLen = *aData\lCurSize
 SourceMem = *aData\pData 
 CompLen   = Round(1.001 * SourceLen,#PB_Round_Up) + 12
 CompMem   = AllocateMemory(CompLen)
 If CompMem
  zerr=_compress(CompMem,@CompLen,SourceMem,SourceLen)
  If zerr = 0
      *aData\pData = CompMem
      *aData\lMaxSize = CompLen
      *aData\lCurSize = CompLen
     [b]FreeMemory(Sourcemem)[/b] error L'argument memoryid spécifié n'est pas valide 
      lbError = #True 
   EndIf
  EndIf
  ProcedureReturn lbError  
EndProcedure
with PDF 2.24 32 bits on a computer with Seven and PPUREPDF lib
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

loulou25223 wrote:I have a problem with compressed
When i use it the programm fall down on this instruction :

Code: Select all

...[b]FreeMemory(Sourcemem)[/b] error L'argument memoryid spécifié n'est pas valide ...
with PDF 2.24 32 bits on a computer with Seven and PPUREPDF lib
I have no Problems here with PB 5.11 / 5.21 LTS x86.

What PureBasic Version are you using ?
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

I comment this instruction and after i have no problem all is good and the file is compressed well.
Is-it normal ?
Thanks for your answering
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PurePDF Version 2.0

Post by DoubleDutch »

YOu should check to see if SourceMem is zero at the beginning:

Code: Select all

Procedure.l PDFCompress(*aData.MEM_DataStructure)
 Protected zerr,CompMem,SourceLen,SourceMem,CompLen,lbError
  ;   check sourcemem here - see if it is zero!
 lbError = #False
 SourceLen = *aData\lCurSize
If it is zero then then you have a bug before PDFCompress.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Is the Purifier enabled ? If yes you should use the includefile method instead of the lib.

[Edit]Workaround:

Code: Select all

      DisableDebugger
      FreeMemory(Sourcemem)
      EnableDebugger
loulou25223
User
User
Posts: 32
Joined: Thu Jan 16, 2014 7:07 pm

Re: PurePDF Version 2.0

Post by loulou25223 »

With PB 5.22 BETA
Error in PDF_COMPRESS() function
Structure aData.MEM_DataStructure introuvable
ABBKlauss can you see Please ?
Thanks in advance
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

I get the same errormessage in 'Tutorial05 Compressed.pb' saying 'Line 36: Structur not found: MEM_DataStructure.' when in the residents Folder the file 'PurePDF_res.res' is missing ;-)
Did i already mentioned the XIncludefile method ? :twisted:
normeus
Enthusiast
Enthusiast
Posts: 470
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: PurePDF Version 2.0

Post by normeus »

ABBKlaus,

I downloaded what I figured was the latest PurePDF. ( With the rest of the world using DD/MM/YYYY and USA using MM/DD/YYYY kind of gets difficult to figure out the right date :wink: ).

Version 2.25 for P.B.51 & P.B.52

Bookmarks are not working anymore.

Version 2.24 bookmarks work fine.


Norm.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

normeus wrote:ABBKlaus,

I downloaded what I figured was the latest PurePDF. ( With the rest of the world using DD/MM/YYYY and USA using MM/DD/YYYY kind of gets difficult to figure out the right date :wink: ).

Version 2.25 for P.B.51 & P.B.52

Bookmarks are not working anymore.

Version 2.24 bookmarks work fine.


Norm.
Thanks for the finding and sorry for the delay.
Can you test this Version before i TailBite a new Version ?

http://www.purebasicpower.de/downloads/PurePDF.pb
http://www.purebasicpower.de/downloads/PurePDF_res.pb

BR Klaus
normeus
Enthusiast
Enthusiast
Posts: 470
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: PurePDF Version 2.0

Post by normeus »

ABBKlaus,

Tried this version (v2.25 file date jan-29-2014) and bookmarks worked fine.
While testing bookmarks I mistakenly created a subbookmark without a parent.

Code: Select all

pdf_BookMark("Paragraph 1",2,-1) ; oops 2 without a 1
pdf_Cell(0,6,"Paragraph 1")
pdf_Ln(10)
pdf_BookMark("Paragraph 1.1",1,-1)
I got an:
[ERROR] The list doesn't have a current element.
in
Procedure ipdf_PutBookMarks()
lparent lru()
----
I think I would just make "2" a parent in case there were any children but then again since this was an error on the programmer side you could just return a pdf error "Child bookmark no parent".


Thank you,
Norm.
Post Reply