PDA

View Full Version : PDF: Haru Library



sandyrepope
09-12-2007, 23:25
I've been reading about the two pdf scripts under pdf contained in the sample scripts and was wondering.....

Has work stopped on this? What is the latest news about it?

Thanks
Sandy

ErosOlmi
10-12-2007, 11:35
PDF is an old module base on isedquickpdf: http://www.isedquickpdf.com/ http://www.quickpdf.org/
When I started, it seemed that the library would have moved to freeware due to problems with the developer. But this didn't happen and now the situation is unknown.

I will try to find another library, now free, to work with. A good option can be libharu for which José Roca has already developed headers files for Power Basic: http://www.jose.it-berater.org/smfforum/index.php?topic=373.0

Gerald Sutherland
07-06-2011, 02:20
Hello,

I was wondering if anyone had been able to get LibHaru working with thinBasic?

Thanks in advance for any advice. :-)

Gerald Sutherland

ErosOlmi
08-06-2011, 08:47
Ciao Gerald and welcome to thinBasic community forum.

I'm sorry but I still didn't had time to work on replacing a PDF Library.

Just in case someone would like to have a look, I noticed Josè link to LibHaru is changed. It is now at http://www.jose.it-berater.org/smfforum/index.php?topic=3058.0

Ciao
Eros

Gerald Sutherland
08-06-2011, 16:18
Hello Eros,

Thank you for responding!

I'm just starting to look into thinBasic (so I have no idea what I am talking about yet). I looked at Jose's PowerBASIC headers and my first impression is that replacing the macros would cover a lot of the changes (but I don't want to be stealing Jose's work). The error handler was where I got confused since I don't see "codeptr" in thinBasic and I'm not sure how to handle CDECL in headers since that doesn't seem to exist in thinBasic either. I'm sure there must be some way around these issues, but I have no idea where to start.

Thanks for your time!

Petr Schreiber
08-06-2011, 18:12
Gerald,

maybe I have something for you, please stay tuned!


Petr

Petr Schreiber
08-06-2011, 20:57
Hi,

I originally wanted to ask José for permission to use his headers, then I decided that would not be fair to absorb his work, so I downloaded libHaru and saw there is ton of the H files. In the end, I just translated the same files as José did, but slightly differently (and with possible mistakes). Now I see what kind of torture José feels when providing his flood of headers :p. In the end I compared the translations (and it was good idea, as I originally translated const char* as byval x as dword, while josé uses more elegant byref asciiz).

The one bigger thing I did steal from José were the DLL files and one sample code, which I adapted to ThinBASIC. And yes, including CODEPTR :D In the end I found possible way, which was to create the callback in Oxygen and link it to ThinBASIC, hehe.

In the attachement you can find 3 tBasicU files (translated headers) + one FontDemo sample + the DLLs. On my PC it works, I hope it will on yours too.

If anyone wishes to finish the translation, the original header files are here:
http://libharu.org/wiki/Downloads


Petr

Gerald Sutherland
08-06-2011, 21:18
Thank you, Petr!

I'll check it out, although it may be a while before I can do very much (preparing for vacation). But as I do, I'll let you know how it works out. There are a lot of things in the LibHaru library that I would probabl not have use for, but I can certainly start with the basics.

I have to agree, Jose does an incredible amount of work for the programming community and I would not want to infringe on his work.

Thanks again!

José Roca
08-06-2011, 21:24
Petr,

You can do with my translations for third party controls wathever you wish. They are posted separately and not integrated in my headers. What I'm interested is in keeping the integrity of my Windows API Headers because they are becoming an application framework and having different versions will lead to incompatibilities.

My translation for libHaru has all the needed headers. The other .h files are for compiling the library, not to use the .DLL.

Gerald Sutherland
09-06-2011, 05:37
Petr,

I tried it this evening and started off with by getting a lot of errors (thinBasic does not like the 'C' comment blocks). Anyway, I changed all of that to apostrophes, but then I was getting errors on split lines. I couldn't make any sense out of those ... the error claimed that an opening "(" was missing ... but it clearly was there. I wonder if the way the lines was wrapped with " _" has anything to do with it. Oh well, I'll try look at it closer this weekend. I'd love to get a shell working to that I could create a polar chart for antenna radiation patterns (which I would gladly share back to the community as a demo script). Thank you!



Jose,

(sorry, I'm not sure how to get the accent marks here)

Thank you very much for your generosity!!

ErosOlmi
09-06-2011, 06:48
What thinBasic version have you installed?
Be sure you have latest beta 1.8.7.0

Petr Schreiber
09-06-2011, 10:14
Hi,

I am 99.9% sure the problem is in old version of thinBasic, as Eros writes.

I use 1.8.7.0 and no errors are generated. You can get it here:
http://www.thinbasic.com/community/showthread.php?11148-thinBasic-Beta-1.8.7.0


Petr

ErosOlmi
09-06-2011, 12:47
It is almost time to remove thinBasic 1.8.0.0 (that is some hundred changes old) and set next version as stable one.

José Roca
09-06-2011, 14:00
BEWARE! The DLL that comes with my translated headers use the CDECL convention.

A problem with many OpenGL libraries is that the author does not provide binaries, only soure code that you have to compile. And the DLL for Windows that I did find was compiled using the CDECL convention instead of STDCALL.

I had problems using that .DLL, until I tried CDECL, because older versions were compiled using STDCALL.

As it depends of the guy that compiles the code, I don't know if the next version that I will find will use CDECL or STDCALL. This is why I have used a MACRO for the calling convention. This way I only have to change MACRO HPDF_CALLCONV = CDECL or MACRO HPDF_CALLCONV = STDCALL.



MACRO HPDF_CALLCONV = CDECL

' ========================================================================================
DECLARE FUNCTION HPDF_GetVersion HPDF_CALLCONV LIB "LIBHPDF.DLL" ALIAS "HPDF_GetVersion" ( _
) AS DWORD ' char *
' ========================================================================================
Petr's translation isn't using CDECL and this will cause stack problems.

Petr Schreiber
09-06-2011, 14:29
José,

thanks for pointing it out. Here I attach corrected version.


Petr

Gerald Sutherland
09-06-2011, 16:18
Thanks to all !!

I was using version 1.8.6.0. I've downloaded 1.8.7.0 and the updated demo files and I'll try it again as soon as I can.

Thanks!!

Gerald Sutherland
09-06-2011, 21:15
Just wanted to let you know that with version 1.8.7.0 ... the demo worked well !! Now I have my foot in the door and will see if I can create a graphic demo to share. Thank you!

ErosOlmi
09-06-2011, 22:52
Petr,

thanks a lot for your great work and thanks to José for his always tremendous interface conversion activity.

Petr, I was thinking it is worth to consider including your work as standard in thinBasic distribution. Haru licence (http://libharu.org/wiki/FAQ) seems permitting it.

Eros

Petr Schreiber
10-06-2011, 13:24
Hi Eros,

no problem, let's include it :) The license is really friendly.
Only problem is, that users will have to take care of including the LibHaru.DLL with their apps.


Petr

Gerald Sutherland
10-06-2011, 21:45
Petr,

I took your demo and replaced the central section with code to create a simple polar chart. I haven't taken time to clean out the variables that I did not use ... or add text labels yet ... I just wanted to get a quick test going.

So far, it looks like LibHaru is going to work out well.

Thank you!

Petr Schreiber
11-06-2011, 10:51
:o

Looks great! The LibHaru has more power than I expected!


Petr

Gerald Sutherland
12-06-2011, 06:40
I've managed to go a bit further with a new demo. I can see I have a lot to learn about thinBasic and LibHaru ... I got into trouble with Oxygen when I was trying to use a font in a function. Anyway, I pulled all the code back up to the main routine, then added more details to the polar chart (azimuth and dB labels, arrows, relative voltage tick marks and labels on the 180 degree radial, etc.). I also added some pattern data which is then plotted on the chart.

Sorry for the poor code formatting ... I'll learn eventually. :-)

I'll try to do more when I get back from vacation.