![]() |
|
|||||||
| Third-Party Addons User to user discussions of third-party addons and user-recommended links to related web sites. Advertisements are permitted only in this forum, for products designed to work with and enhance PowerBASIC compilers. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
libharu headers for PowerBASIC
What is Haru Free PDF Library?
HARU is a free, cross platform, open-sourced software library for generating PDF. It supports the following features. 1. Generating PDF files with lines, text, images. 2. Outline, text annotation, link annotation. 3. Compressing document with deflate-decode. 4. Embedding PNG, Jpeg images. 5. Embedding Type1 font and TrueType font. 6. Creating encrypted PDF files. 7. Using various character set (ISO8859-1~16, MSCP1250~8, KOI-8R). 8. Supporting CJK fonts and encodings. You can add the feature of PDF creation by using HARU without understanding complicated internal structure of PDF. Web site: http://sourceforge.net/projects/libharu/ What is new in version 2.08? Version 2.08 is a maintenance release that includes the following changes: * Fixed a problem of HPDF_Circle() that causes buffer overflow. * Added HPDF_Ellipse(). I have translated the headers and examples and posted them in my forum. http://www.forum.it-berater.org/index.php?topic=887.0 The attachment contains the translation of the headers and examples to PowerBASIC. Preserve the directory structure when unzipping. It doesn't include libhpdf.dll, that must be downloaded from the sourceforge link above listed. ------------------ Website: http://com.it-berater.org SED Editor, TypeLib Browser, COM Wrappers. Forum: http://www.forum.it-berater.org [This message has been edited by José Roca (edited March 03, 2007).]
__________________
Website: http://www.jose.it-berater.org/index.html SED Editor, TypeLib Browser. Forum: http://www.jose.it-berater.org/smfforum/index.php |
|
#2
|
|||
|
|||
|
Great stuff!
Would be nice to shell to the documents after creation. Working on it. ------------------ |
|
#3
|
|||
|
|||
|
'"hpdf.inc"
'Added this code: Code:
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' ShellDocument by Don Dickinson
' opens a document with a registered extension
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SUB ShellDocument ALIAS "ShellDocument" (BYVAL sFile AS STRING) EXPORT
ShellExecute 0, BYVAL %null, sFile + $NUL, BYVAL %null, BYVAL %null, _
%SW_NORMAL
END SUB
Then at the end of examples:
ShellDocument fname
|
|
#4
|
|||
|
|||
|
Not yet tested but knowing your "guru" level I'm 110% sure it will be perfect.
Thank you very much. Eros ------------------ thinBasic forum mailto:eros.olmi@thinbasic.comeros.olmi@thinbasic.com</A>
__________________
www.thinbasic.com | community.thinbasic.com | psch.thinbasic.com Win7Pro 64bit - 8GB Ram - i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB |
|
#5
|
|||
|
|||
|
Thanks, Jose.
I did the PB headers for the older C++ version of libHaru (they're posted here somewhere), but never got around to updating them when the author rewrote the lib in C. BTW, it's documented here: http://libharu.sourceforge.net/ ------------------ [This message has been edited by Paul Franks (edited March 03, 2007).]
__________________
|
|
#6
|
|||
|
|||
|
I'm aware of it. Didn't used them because you said that Takeshi was
working in a new version. BTW users of earlier versions of PBWIN and PBCC will need to change the names of some members of the structures (e.g. left, right, width), because they don't allow the use of reserved names as members of UDTs. Also, in some of the examples, they will have to change ARRAY ASSIGN and use individual assignments. ------------------ Website: http://com.it-berater.org SED Editor, TypeLib Browser, COM Wrappers. Forum: http://www.forum.it-berater.org
__________________
Website: http://www.jose.it-berater.org/index.html SED Editor, TypeLib Browser. Forum: http://www.jose.it-berater.org/smfforum/index.php |
|
#7
|
|||
|
|||
|
Jose,
Just simpel thanks unlimited times for the PDF stuff. ![]() ------------------ To Ask or Not To Ask ?
__________________
To Ask or Not To Ask ? |
|
#8
|
|||
|
|||
|
One problem remains. There are several functions that return an UDT.
Sometimes, this can be solved declaring the return type as a DWORD and the assigning the value to a variable declared as <udt name> PTR to access the members, but I have tried with one and causes the program to GPF when it ends. Maybe its an incompatibility of the GCC compiler. See: http://gcc.gnu.org/onlinedocs/gcc/In...ibilities.html Takeshi has added new "2" functions that allow to pass the UDT by reference, but only for the ones that caused problems to Delphi. Maybe we can convince him to add new "2" functions for the remaining ones. ------------------ Website: http://com.it-berater.org SED Editor, TypeLib Browser, COM Wrappers. Forum: http://www.forum.it-berater.org
__________________
Website: http://www.jose.it-berater.org/index.html SED Editor, TypeLib Browser. Forum: http://www.jose.it-berater.org/smfforum/index.php |
|
#9
|
|||
|
|||
|
Hello José,
i'm very interested in your header/translated examples. Unfortunately i cannot detect any way to detach the attachment in the posting of your forum you have linked. thanks Hans ------------------ |
|
#10
|
|||
|
|||
|
The forum has moved to other domain. This is the new link: http://www.jose.it-berater.org/smffo...hp?topic=373.0 You will need to register first. ------------------ Website: http://com.it-berater.org SED Editor, TypeLib Browser, COM Wrappers. Forum: http://www.jose.it-berater.org/smfforum/index.php
__________________
Website: http://www.jose.it-berater.org/index.html SED Editor, TypeLib Browser. Forum: http://www.jose.it-berater.org/smfforum/index.php |
|
#11
|
|||
|
|||
|
Unless the ANSI C/C++ committee has made a change, all vars are passed by
value. Normally there are two ways to pass a structure by either assigning a pointer to it or passing it's address with the ampersand in front of the var. Now I don't know diddly about GCC or Delphi, But standard C/C++ convention is by value. Cheers ![]() ------------------ |
|
#12
|
|||
|
|||
|
The problem is not about passing parameters, but with some functions
that return an structure. While other C compilers copy the data into an area of static storage and then return the address of that storage, gcc apparently uses a non-compatible method. Quote:
------------------ Website: http://com.it-berater.org SED Editor, TypeLib Browser, COM Wrappers. Forum: http://www.jose.it-berater.org/smfforum/index.php
__________________
Website: http://www.jose.it-berater.org/index.html SED Editor, TypeLib Browser. Forum: http://www.jose.it-berater.org/smfforum/index.php |
|
#13
|
|||
|
|||
|
I'm finding the libharu library to be an excellent alternative to most of the other PDF tools. My humble thanks to Jose for the headers!
I've run into one problem though. If anyone has an answer, I'd appreciate it. On one half of my page, I need to print a series of dollar amounts. The left boarder contains the fee's description with the dollar amount following. I can't seem to get the amounts to right justify though. I've tried doing a RSET and FORMAT$ but the digits are off depending on the size of the number of value. I'm using a fixed-width font, but that doesn't seem to help either. Short of calculating the exact left margin for each value, does anyone know of a way to properly right justify the output like this? TIA ------------------ * Americans: Time for the right party ------------------------- Read my Blog
__________________
All those in favor of global warming, please raise your hands
|
|
#14
|
|||
|
|||
|
Joe,
If you haven't already found a solution, search the Source Code forum (it's so nice to have a search feature that actually works now ) for libharu, I'm pretty sure I posted a report example a while ago that has justification options. It would have been for the original version of libharu, but might be adaptable with minimal effort.
__________________
|
|
#15
|
|||
|
|||
|
LibHaru ReadFromStream problem
Hi All,
The following declare uses a byte pointer to buf. Is there any way I can call this function from PowerBasic? I do not know how to use a byte pointer. DECLARE FUNCTION HPDF_ReadFromStream LIB "libhpdf.dll" ALIAS "HPDF_ReadFromStream" ( _ BYVAL HPDF_Doc, _ ' HPDF_Doc pdf BYREF HPDF_BYTE, _ ' HPDF_BYTE *buf BYREF HPDF_UINT32 _ ' HPDF_UINT32 *size ) AS HPDF_STATUS ' HPDF_STATUS Ken |
![]() |
| Thread Tools | |
| Display Modes | |
|
|