Flype UserLibraries for PureBasic 4.0

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

RMChart Include Update to make it more PB4.02 friendly.
Please look at the examples because some changes have been done.

Download it on the first post near RMCHART.DLL / Lastest Release
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Regarding PurePDF

Post by Yogi Yang »

Hello Flype,

Regarding PurePDF.

The lib is impressive. But is it possible to create Fillable PDF Forms using your library.

I want to create PDF Forms which users and load in Acrobat Reader and fill them and save them as PDF again. Can such a feature be implemented using your PDF Lib?

TIA
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

hello yogi yang,

first i want to say that PurePDF is not mine.some month ago,
i have made my own release (as it is opensource) to make it compatible with PB4.0. This lib is written first by LuckyLuke and then by ABBKlaus. Since some weeks an official release is available for PB4. So my own version is no more useful.

Anyway, it is a good idea but i have no idea how to implement forms in PDF.
But yes it would be very useful. I might use it at work if such a functionality exists. One day perhaps if documentation is available.......
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Yogi Yang
Enthusiast
Enthusiast
Posts: 107
Joined: Sun Dec 11, 2005 2:19 pm

Post by Yogi Yang »

Flype wrote:hello yogi yang,

first i want to say that PurePDF is not mine.some month ago,
i have made my own release (as it is opensource) to make it compatible with PB4.0. This lib is written first by LuckyLuke and then by ABBKlaus. Since some weeks an official release is available for PB4. So my own version is no more useful.

Anyway, it is a good idea but i have no idea how to implement forms in PDF.
But yes it would be very useful. I might use it at work if such a functionality exists. One day perhaps if documentation is available.......
Sorry to bother you.

You see I have developed a set of software for a client where a user will use FormDesigner and load a scanned pre printed form, place various controls on it at locations where data needs to be entered.

This layout is saved into an XML file and there is another software - Reader which will read the XML and present the user with the saved layout and allow to type in necessary text, select required options, check (tick) various items, etc. etc. and finally save the form in XML format with entered data.

This Reader also allows one to export the form without/without data to various bitmap formats and to PDF.

Now the client requires that the layout should be exportable to PDF in fillable forms.

I think I will have to purchase Foxit PDF SDK for this.... Any ideas would be appreciated.

Thanks,
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

UserLibrary PureXML2 for PureBasic 4.02.

PureXML_V2_BETA 105Ko.


Complete Rewrite of PureXML.

There's NO more need for a XML DLL.

This lib is totally freeware of course,
but it is still in Beta test until it's done.
Last edited by Flype on Mon Jan 15, 2007 1:00 pm, edited 2 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Image
thx, is there a change for a unicode and/or threadsafe version?
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes it could ! i just need to compile them.

but at the moment,
i'm first concentrating on the ascii version to eliminate all bugs / expands functionalities.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

No problem, i can wait :wink:
There is a bug with the helpfile: false name and index incorrect.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

Flype wrote:UserLibrary PureXML2 for PureBasic 4.02.
Thank you for your lib! :D

Here are my first bug-report: ;-)

The following XMLs are wellformed, but your lib parse neither of them:

Code: Select all

<test>
<!-- <test> -->
</test>

Code: Select all

<test>
<test2><![CDATA[this is a cdata-section]]></test2>
</test>
Greetings ... Kiffi

// Edit: Removed broken image-link
Last edited by Kiffi on Sun Mar 16, 2008 9:27 pm, edited 1 time in total.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

ts-soft wrote:No problem, i can wait :wink:
There is a bug with the helpfile: false name and index incorrect.
yes, at the moment, the helpfile is the (very) old one (purexml v1) which is not good.
better read the PureXML2.txt during beta stage.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

the libs are very useful. Thanks. :wink:
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Kiffi wrote:
Flype wrote:UserLibrary PureXML2 for PureBasic 4.02.
Thank you for your lib! Image

Here are my first bug-report: ;-)

The following XMLs are wellformed, but your lib parse neither of them:

Code: Select all

<test>
<!-- <test> -->
</test>

Code: Select all

<test>
<test2><![CDATA[this is a cdata-section]]></test2>
</test>
Greetings ... Kiffi
updated - beta2.

all should works.
i included this 2 new examples.
Last edited by Flype on Mon Jan 15, 2007 1:01 pm, edited 2 times in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
davenull
User
User
Posts: 25
Joined: Sat Sep 17, 2005 5:31 pm
Location: Finland

Post by davenull »

Title: PureXML2 BETA
Version: 2.0 Beta2 (15-Jan-2007 01:36)
License: Free to use, greetings are welcome.

Author: Written by Flype, flype44(at)gmail.com.

Target: This UserLibrary is intended to be used with PureBasic 4.02
OS: Microsoft Windows (Only tested on XP).

Descript: PureXML is a event-based XML parser, based on Expat 2.0.0.
No DLL required - Small footprint (about 100Kb) !
Thanks! Greatly appreciated. I will test this out as soon as possible.

-davenull-
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Updated - Beta3

UserLib_PB402_PureXML_V2_BETA.zip (207 Ko)

Please read the README.txt.
Many changes (syntax modified and functions added).

No Multithreaded/Unicode support at the moment.
It's the next step... The last one will be the CHM.

Code: Select all

_______________________________________________________________________________________________________________

Title:    PureXML2 BETA 
Version:  2.0 Beta3 (15-Jan-2007 01:36)
License:  Free to use, greetings are welcome.

Author:   Written by Flype, flype44(at)gmail.com.

Target:   UserLibrary designed for PureBasic 4.02
OS:       Microsoft Windows (Only tested on Windows XP SP2).

Descript: PureXML is a event-based XML parser, based on Expat 2.0.0.
          No more DLL required - Small footprint (about 100Kb) !

Download: http://purebasic.myftp.org/?filename=files/44/PB4_UserLibs/UserLib_PB402_PureXML_V2_BETA.zip

_______________________________________________________________________________________________________________

List of functions :

PureXML_GetEngine()              ; Retrieves the version of the internal XML engine.
PureXML_GetVersion()             ; Retrieves the version of the PureXML UserLibrary.

PureXML_GetErrorString()         ; Returns the error that has occurred as string.
PureXML_GetErrorCode()           ; Returns the error that has occurred as errorcode.

PureXML_GetAttr(name.s)          ; Returns the attribute value (by name).
PureXML_GetAttrCount()           ; Returns the number of attributes.
PureXML_GetAttrName(index.l)     ; Returns the attribute name (by index).
PureXML_GetAttrValue(index.l)    ; Returns the attribute value (by index).

PureXML_GetBuffer()              ; Returns the internal buffer string of the current parsing.
PureXML_GetColumn()              ; Returns the column number of the current parsing position.
PureXML_GetDepth()               ; Returns the tag's depth of the current parsing position.
PureXML_GetLine()                ; Returns the line number of the current parsing position.
PureXML_GetPosition()            ; Returns the byte-offset of the current parsing position.

PureXML_GetBase()                ; Returns the base for resolving relative URLs.
PureXML_GetCDATA()               ; Returns the CDATA Section of the current element.
PureXML_GetCharData()            ; Returns the characters data of the current element.
PureXML_GetName()                ; Returns the name of the current element.
PureXML_GetPath()                ; Retrieves the path of the current element.
PureXML_GetStatus()              ; Returns the parsing status between 0, 1, 2, 3.

PureXML_SetBase(base.s)          ; Specify the base to be used for resolving relative URLs. 
PureXML_SetEncoding(encoding.s)  ; Specify the encoding type between US-ASCII, UTF-8, UTF-16, ISO-8859-1.

PureXML_ParseFile(fileName.s)    ; Parse a XML document.
PureXML_ParseString(xmlString.s) ; Parse a XML string.
PureXML_ParseUrl(url.s)          ; Parse a XML url.
PureXML_ParseResume()            ; Resumes the current parsing, if suspended with PureXML_Stop(#True). 
PureXML_ParseStop([resumable.l]) ; Stops the current parsing.

_______________________________________________________________________________________________________________

List of PureXML Handlers :

PureXML_SetAttributeHandler(*hProcedure)                   ; PureXML Handler: Attribute (name, value) of an element.
PureXML_SetCDataSectionHandler(*hProcedure1, *hProcedure2) ; PureXML Handler: Start and End of a CDATA Section.
PureXML_SetCharacterDataHandler(*hProcedure)               ; PureXML Handler: Characters data between two elements.
PureXML_SetCloseHandler(*hProcedure)                       ; PureXML Handler: End of an element.
PureXML_SetCommentHandler(*hProcedure)                     ; PureXML Handler: Comments.
PureXML_SetDefaultHandler(*hProcedure)                     ; PureXML Handler: Default.
PureXML_SetElementHandler(*hProcedure1, *hProcedure2)      ; PureXML Handler: Start and End of an element.
PureXML_SetEndCDataSectionHandler(*hProcedure)             ; PureXML Handler: End of a CDATA Section.
PureXML_SetOpenHandler(*hProcedure)                        ; PureXML Handler: Start of an element.
PureXML_SetStartCDataSectionHandler(*hProcedure)           ; PureXML Handler: Start of a CDATA Section.
PureXML_SetXmlHandler(*hProcedure)                         ; PureXML Handler: Xml Declaration.

_______________________________________________________________________________________________________________

PureXML Handlers syntax :

Procedure myAttribute(name.s, attrName.s, attrValue.s)
EndProcedure

Procedure myCharacterData(name.s, string.s, length.l)
EndProcedure

Procedure myComment(name.s, string.s, length.l)
EndProcedure

Procedure myDefault(name.s, string.s, length.l)
EndProcedure

Procedure myEndElement(name.s, depth.l)
EndProcedure

Procedure myEndCDataSection(name.s, string.s, length.l, position.l)
EndProcedure

Procedure myStartCDataSection(name.s, position.l)
EndProcedure

Procedure myStartElement(name.s, depth.l)
EndProcedure

Procedure myXml(xml_version.s, xml_encoding.s)
EndProcedure

_______________________________________________________________________________________________________________

Best Regards, flype 2007.
Last edited by Flype on Mon Jan 15, 2007 1:55 pm, edited 1 time in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Here is a small example to introduce PureXML2.

This shows how to very easily retrieves partial informations
from a distant XML document using ParseUrl() and the CharacterData handler.

Code: Select all

Global result$

Procedure.l Extract_From_IpPages(name.s, string.s, length.l)
  
  Select name ; tag name
    Case "ip":      result$ + "IP V4: " + #TAB$ + string + #CRLF$
    Case "ip_long": result$ + "IP: "    + #TAB$ + string + #CRLF$
    Case "ipv6":    result$ + "IP V6: " + #TAB$ + string + #CRLF$
    Case "host":    result$ + "HOST: "  + #TAB$ + string + #CRLF$
    Case "isp":     result$ + "ISP: "   + #TAB$ + string + #CRLF$
    Case "country": result$ + "CTRY: "  + #TAB$ + string + #CRLF$
  EndSelect
  
EndProcedure

If MessageRequester("Question", "Resolves your IP Address from `ippages.com` ?", #MB_OKCANCEL|#MB_ICONQUESTION) = #IDOK
  
  PureXML_SetCharacterDataHandler(@Extract_From_IpPages())
  
  If PureXML_ParseUrl("http://www.ippages.com/xml/")
    
    If MessageRequester("Copy the result to the clipboard ?", result$, #MB_OKCANCEL|#MB_ICONINFORMATION) = #IDOK
      
      SetClipboardText(result$)
      
    EndIf
    
  Else
    
    MessageRequester("Error", PureXML_GetErrorString(), #MB_ICONERROR)
    
  EndIf
  
EndIf
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Post Reply