PurePDF library 1.0 BETA

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Sweet.
Thanks LuckyLuke :)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Bernard
User
User
Posts: 23
Joined: Sun Apr 27, 2003 4:49 pm
Location: France

Post by Bernard »

How can I do if I want to show the PDF document immediately ?
Bernard
LuckyLuke
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Jun 06, 2003 2:41 pm
Location: Belgium

Post by LuckyLuke »

RICARDO created a PDF Viewer ...

viewtopic.php?t=6272&start=0&postdays=0 ... &highlight

or run the acrobat reader with the file you want to open :

Code: Select all

acrord32 <filename>.pdf
Hope this helps.
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

LuckyLuke,

I checked your lib which works fine. This is a good work.

BTW I would like to find a way to open a PDF file getting the text it contains.

Does your lib allow such a thing ?

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
LuckyLuke
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Jun 06, 2003 2:41 pm
Location: Belgium

Post by LuckyLuke »

fweil,

My lib doesn't allow this (yet?).
If the file is protected, I think it's not possible to get the text.
Using the ZUserLIB of schic we can create a "readable" text file. Parsing this file and obtaining the text (though not formatted) should be possible.

BTW the cleanup of the code is almost done. Will release sources soon.

Am curious who is using this lib ...

Rgrds
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

I'm using the lib for a new project... For generating reports, letters, faxes, invoices (well everything that needs to get outputed) :P

Beats PB StarDrawing(windowoutput()) :wink:

Would like this lib to work under linux too...

If not this project will probably end up has a web server running on a Windows box with linux clients 8)

Server is 90% done, it supports HTTP 1.1 + cookies + Form Handling + private commands... To many head haches and RFC reads...

If anyone want's to learn how a browser "speaks and reads" better install HttpHeaders plugin for Mozilla or IE to sniff the packages :P

You'll quickly learn Micro$oft web servers do not respect the HTTP protocol!
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

LuckyLuke,

No real use right now, but I guess your lib is good and easy to use so that I will certainly use it soon for generating outputs from programs.

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
Bernard
User
User
Posts: 23
Joined: Sun Apr 27, 2003 4:49 pm
Location: France

Post by Bernard »

When I try to do a big document (about 400 pages) I have a messagebox error with oeps in the title bar and no more explications do you this error ?
Bernard
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

I also have a crash when converting a large text file to PDF.

It seems that when using ManipulationBufferSize() (see the apropriate topic), this changes the time before the crash occurs.

Should it mean that this lib does not accept long strings right now ?

Probably it uses regular PB string functions that does not support long strings even if you change the heapalloc parameter.

If any help need about ... maybe I can do something LuckyLuke

Rgrds
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

LuckyLuke wrote:Am curious who is using this lib ...
me , coz its very very usefull for appz (like NUM describes) :)
SPAMINATOR NR.1
LuckyLuke
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Jun 06, 2003 2:41 pm
Location: Belgium

Post by LuckyLuke »

@Bernard:
The messagebox Oeps appears becaue not enough memory is available. (forgot about this debug message :oops: )

The sourcecode + tutorials can be found at :
http://smollies.fateback.com/purePDF.zip

Thanks again for the information/comments. :D
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

oops

Post by DominiqueB »

With the last package, the 15,16,17 samples can't be compiled . . .
Not the good lib release ?

Dominique
Dominique

Windows 10 64bits. Pure basic 32bits
LuckyLuke
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Jun 06, 2003 2:41 pm
Location: Belgium

Post by LuckyLuke »

The lib needs to be recompiled ... sources are up to date.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

BAD BUG :(

I'm parsing a 200K flat text file and saving it to a PDF table and i've discovered that to generate a 400k pdf (30 A4 pages) the lib sucks 400mb of page file memory!!!

I think thats too excessive, but the problem is that the page file is not freed until the app quits!

If you call it several times or try to make a large PDF you run out of memory! That's what makes it crash... 8O

I've taken a look to the source (i was trying to port it to linux and even made my own procedures) it seems that the problem is with the constant reallocation of memory.

I suggest a change to the lib, instead of making every thing in memory it might be better to stream directly to the PDF file, so each time you call a function the PDF script is saved at once.

That would improve speed and memory waste...

Anyway, it's still a great lib and i know it has taken you quite some time to make it :wink:
LuckyLuke
Enthusiast
Enthusiast
Posts: 181
Joined: Fri Jun 06, 2003 2:41 pm
Location: Belgium

Post by LuckyLuke »

Hi,

Found major bug ...
Changing the existing code to this one for _DataAddString (Datafunction.pbi) will increase speed and less memory usage ...

I used Tailbite (Version: 1.2 Beta 1.2 Date: July 20th 2004).

@Num3:
Please let me know if this solves your problem.

Code: Select all

; _DataAddString
;===============
; Returns #FALSE : Couldn't add source to destination
;         #TRUE  : Operation is succesfull
;====================================================
Procedure.b _DataAddString(*aData.strData, as.s)  
  Protected llLen.l
  Protected sTmp.strData
  Protected lbError.b
   
  llLen = Len(as)
 ; If (_DataInit(sTmp, llLen,  #DATANEW)) = #TRUE
    sTmp\pData = @as
    sTmp\lCurSize  = llLen
    sTmp\lMaxSize  = llLen
    lbError = _DataAdd(*aData, sTmp)
 ; Else
  ;  lbError = #FALSE
  ;EndIf
  ProcedureReturn lbError 
EndProcedure
Post Reply