Announcement

Collapse
No announcement yet.

libHaru 2.1.0 Headers for PowerBASIC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • libHaru 2.1.0 Headers for PowerBASIC

    A translation of the libHaru 2.1.0 headers for PowerBASIC is available to download in my forum:



    Contrarily to previous versions of the library, this version uses CDECL instead of STDCALL as the calling convention.

    The attachment includes also the DLLs and examples. If you use the include files provided with the compiler instead of my include files, change #INCLUDE ONCE "windows.inc" to #INCLUDE ONCE "win32api.inc" in the examples.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

  • #2
    HARU is a free, cross platform, open-sourced software library for generating PDF.
    Thanks José. I had not heard of Haru before. Looks interesting.
    Bernard Ertl
    InterPlan Systems

    Comment


    • #3
      Jose, for those of us new to making PDF files with any third party software,
      can you post a step-by-step instruction including the files to use from what
      zip files and their location and a small program that creates a sample pdf file
      using PB ? Thanks in advance. such as
      1. download xyz.fil from here ->
      2. download headers from here ->
      3. save it to .....
      4. unzip the dadada.file
      5. include ... file(s) in your code
      6. sample code.
      this will create a pdf file that should read

      I know you have answered some of these already, but a step-by-step procedure in one place would certainly be helpful for those of us who haven't
      a clue about how to go about it.
      Client Writeup for the CPA

      buffs.proboards2.com

      Links Page

      Comment


      • #4
        The zipped file available in my forum contains all you need. Simply unzip it in any folder of your choice and you are ready. As I have stated, the only change that you may need to do in the examples is to change #INCLUDE ONCE "windows.inc" to #INCLUDE ONCE "win32api.inc" if you want use the Windows API include files provided by PowerBASIC with the compiler instead of my include files. Regarding the libHaru headers, you just need to #INCLUDE "hpdf.inc".
        Forum: http://www.jose.it-berater.org/smfforum/index.php

        Comment


        • #5
          One thing that I have forgot to change in the examples is to add CDECL to the callback error handler procedure. The version that I originally used when I wrote them (2.0.8) used the STDCALL calling convention instead of CDECL.

          Code:
          ' ========================================================================================
          ' Callback error handler procedure
          ' ========================================================================================
          SUB HPDF_Error_Handler [B][COLOR="Red"]CDECL[/COLOR][/B] ( _
             BYVAL error_no AS HPDF_STATUS, _
             BYVAL detail_no AS HPDF_STATUS, _
             BYVAL user_data AS DWORD)
          
             LOCAL strMsg AS STRING
          
             strMsg = "Error number = " & STR$(error_no) & " [&H" & HEX$(error_no) & "]" & $CRLF
             strMsg = strMsg & "Detail number = " & STR$(detail_no) & " [&H" & HEX$(detail_no) & "]"
             ? strMsg
          
          END SUB
          ' ========================================================================================
          Forum: http://www.jose.it-berater.org/smfforum/index.php

          Comment


          • #6
            The documentation and downloads are available in the libHaru site:
            Forum: http://www.jose.it-berater.org/smfforum/index.php

            Comment


            • #7
              I have changed the HPDF_Error_Handler callback procedure to:

              Code:
              SUB HPDF_Error_Handler [B][COLOR="Red"]HPDF_CALLCONV()[/COLOR][/B] ( _
                 BYVAL error_no AS HPDF_STATUS, _
                 BYVAL detail_no AS HPDF_STATUS, _
                 BYVAL user_data AS DWORD)
              
                 LOCAL strMsg AS STRING
              
                 strMsg = "Error number = " & STR$(error_no) & " [&H" & HEX$(error_no) & "]" & $CRLF
                 strMsg = strMsg & "Detail number = " & STR$(detail_no) & " [&H" & HEX$(detail_no) & "]"
                 ? strMsg
              
              END SUB
              where HPDF_CALLCONV() is a macro defined as CDECL in hpdf.inc. This way, if a new version uses STDCALL instead of CDECL we only will need to change the macro.
              Forum: http://www.jose.it-berater.org/smfforum/index.php

              Comment

              Working...
              X