2008-05-18 08:52 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

+ contrib/hbhpdf/Makefile
   + contrib/hbhpdf/make_b32.bat
   + contrib/hbhpdf/make_vc.bat
   + contrib/hbhpdf/make_gcc.sh
   + contrib/hbhpdf/common.mak
   + contrib/hbhpdf/tests/bld_b32.bat
   + contrib/hbhpdf/tests/bld_vc.bat
     + Added build/make files.
     ; Please test GNU make files.

   * contrib/make_b32_all.bat
   * contrib/make_gcc_all.sh
   * contrib/make_vc_all.bat
     + Added hbhpdf to 'all' make files.
       (not yet to GNU make files though)

   - contrib/hbhpdf/tests/<data files>
   + contrib/hbhpdf/tests/files/<data files>
     * Data files needed for test app moved 
       to a subdir.

   * contrib/hbhpdf/tests/harupdf.prg
     ! Absolute paths changed to relative ones 
       (for both input and output ones).
     ! NumToHex() -> hb_NumToHex()
     + hbct added to liblist because test program 
       uses SIN()/COS()/TAN() from it.

   - contrib/hbhpdf/tests/harupdf.ch
   + contrib/hbhpdf/harupdf.ch
     * Moved to main dir.

   - contrib/hbhpdf/hpdf.h
     - Removed original libharu header. This 
       will be picked up from the package dir, 
       along with the rest of the .h files.

   * contrib/hbhpdf/harupdf.ch
     + Added self-guard.

   * contrib/hbhpdf/harupdf.c
     ! Fixed a few BCC warnings. It now builds cleanly.
     ; NOTE: There are a lot MSVC casting warnings and errors left.

   ; Many thanks for this contrib to Pritpal Bedi.
This commit is contained in:
Viktor Szakats
2008-05-18 07:01:45 +00:00
parent db15dcf12e
commit 624403c721
44 changed files with 316 additions and 1243 deletions

View File

@@ -8,6 +8,53 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-05-18 08:52 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
+ contrib/hbhpdf/Makefile
+ contrib/hbhpdf/make_b32.bat
+ contrib/hbhpdf/make_vc.bat
+ contrib/hbhpdf/make_gcc.sh
+ contrib/hbhpdf/common.mak
+ contrib/hbhpdf/tests/bld_b32.bat
+ contrib/hbhpdf/tests/bld_vc.bat
+ Added build/make files.
; Please test GNU make files.
* contrib/make_b32_all.bat
* contrib/make_gcc_all.sh
* contrib/make_vc_all.bat
+ Added hbhpdf to 'all' make files.
(not yet to GNU make files though)
- contrib/hbhpdf/tests/<data files>
+ contrib/hbhpdf/tests/files/<data files>
* Data files needed for test app moved
to a subdir.
* contrib/hbhpdf/tests/harupdf.prg
! Absolute paths changed to relative ones
(for both input and output ones).
! NumToHex() -> hb_NumToHex()
+ hbct added to liblist because test program
uses SIN()/COS()/TAN() from it.
- contrib/hbhpdf/tests/harupdf.ch
+ contrib/hbhpdf/harupdf.ch
* Moved to main dir.
- contrib/hbhpdf/hpdf.h
- Removed original libharu header. This
will be picked up from the package dir,
along with the rest of the .h files.
* contrib/hbhpdf/harupdf.ch
+ Added self-guard.
* contrib/hbhpdf/harupdf.c
! Fixed a few BCC warnings. It now builds cleanly.
; NOTE: There are a lot MSVC casting warnings and errors left.
; Many thanks for this contrib to Pritpal Bedi.
2008-05-17 18:45 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)
+ harbour/contrib/hbhpdf
+ harbour/contrib/hbhpdf/harupdf.c

View File

@@ -0,0 +1,24 @@
#
# $Id$
#
ROOT = ../../
C_SOURCES=\
harupdf.c \
PRG_HEADERS=\
harupdf.ch \
PRG_SOURCES=\
LIBNAME=hbhpdf
CFLAGS := $(CFLAGS) -I/usr/include
include $(TOP)$(ROOT)config/header.cf
INSTALL_RULE_HEADERS := $(INSTALL_RULE)
include $(TOP)$(ROOT)config/lib.cf
install::
$(INSTALL_RULE_HEADERS)

View File

@@ -0,0 +1,16 @@
#
# $Id$
#
LIBNAME = $(LIBPREF)hbhpdf
LIB_PATH = $(LIB_DIR)$(LIBNAME)$(LIBEXT)
PRG_HEADERS = \
harupdf.ch \
LIB_OBJS = \
$(OBJ_DIR)harupdf$(OBJEXT) \
all: \
$(LIB_PATH) \

View File

@@ -1,6 +1,7 @@
/*
* $Id$
*/
/*
* Copyright 2008 Pritpal Bedi<pritpal@vouchcac.com>
*
@@ -45,6 +46,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
@@ -132,7 +134,7 @@ HB_FUNC( HPDF_GETSTREAMSIZE )
HB_FUNC( HPDF_READFROMSTREAM )
{
HPDF_UINT32 size = strlen( hb_parc( 2 ) );
HPDF_ReadFromStream( (HPDF_Doc) hb_parnl( 1 ), hb_parc( 2 ), &size );
HPDF_ReadFromStream( (HPDF_Doc) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), &size );
hb_retnl( size );
}
//----------------------------------------------------------------------//
@@ -407,7 +409,7 @@ HB_FUNC( HPDF_LOADRAWIMAGEFROMFILE )
//
HB_FUNC( HPDF_LOADRAWIMAGEFROMMEM )
{
hb_retnl( (long) HPDF_LoadRawImageFromMem( (HPDF_Doc) hb_parnl( 1 ), hb_parc( 2 ), hb_parni( 3 ), hb_parni( 4 ), (HPDF_ColorSpace) hb_parni( 5 ), hb_parni( 6 ) ) );
hb_retnl( (long) HPDF_LoadRawImageFromMem( (HPDF_Doc) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), hb_parni( 3 ), hb_parni( 4 ), (HPDF_ColorSpace) hb_parni( 5 ), hb_parni( 6 ) ) );
}
//----------------------------------------------------------------------//
// HPdf_LoadJPEGImageFromFile( hDoc, cHPEGFileName ) -> hImage
@@ -1481,7 +1483,7 @@ HB_FUNC( HPDF_FONT_TEXTWIDTH )
PHB_ITEM info = hb_itemArrayNew( 4 );
PHB_ITEM temp = hb_itemNew( NULL );
tw = HPDF_Font_TextWidth( (HPDF_Font) hb_parnl( 1 ), hb_parc( 2 ), hb_parni( 3 ) );
tw = HPDF_Font_TextWidth( (HPDF_Font) hb_parnl( 1 ), (HPDF_BYTE*) hb_parc( 2 ), hb_parni( 3 ) );
hb_arraySet( info, 1, hb_itemPutNI( temp, tw.numchars ) );
hb_arraySet( info, 2, hb_itemPutNI( temp, tw.numwords ) );
@@ -1498,14 +1500,14 @@ HB_FUNC( HPDF_FONT_TEXTWIDTH )
HB_FUNC( HPDF_FONT_MEASURETEXT )
{
hb_retni( HPDF_Font_MeasureText( (HPDF_Font) hb_parnl( 1 ),
hb_parc ( 2 ),
hb_parni( 3 ),
hb_parnd( 4 ),
hb_parnd( 5 ),
hb_parnd( 6 ),
hb_parnd( 7 ),
hb_parl ( 8 ),
NULL ) );
(HPDF_BYTE*) hb_parc ( 2 ),
hb_parni( 3 ),
hb_parnd( 4 ),
hb_parnd( 5 ),
hb_parnd( 6 ),
hb_parnd( 7 ),
hb_parl ( 8 ),
NULL ) );
}
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//

View File

@@ -1,7 +1,13 @@
/*
* $Id$
*/
/*
* Harbour level header for hbhpdf/libharu Library.
*
* Copyright 2008 {list of individual authors and e-mail addresses}
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option )
@@ -42,6 +48,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
@@ -52,6 +59,9 @@
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
#ifndef _HARUPDF_CH
#define _HARUPDF_CH
// HPDF_InfoType
#define HPDF_INFO_CREATION_DATE 0
#define HPDF_INFO_MOD_DATE 1
@@ -800,3 +810,5 @@
#define HPDF_GMODE_EXTERNAL_OBJECT 0x0040
//----------------------------------------------------------------------//
#endif // _HARUPDF_CH

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,62 @@
@echo off
rem
rem $Id$
rem
if not "%LIBHARU_DIR%" == "" goto DIR_OK
echo ---------------------------------------------------------------
echo IMPORTANT: You'll need Haru Free PDF Library (libharu) DLL package
echo from www.libharu.org and this envvar to be set to
echo successfully build this library:
echo set LIBHARU_DIR=-IC:\libharu
echo ---------------------------------------------------------------
goto POST_EXIT
:DIR_OK
set CFLAGS=-I%LIBHARU_DIR%\include
set HB_DLL_NAME=libhpdf
set HB_DLL_DIR=%LIBHARU_DIR%
rem ---------------------------------------------------------------
call ..\mtpl_b32.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
rem ---------------------------------------------------------------
set _HB_INSTALL_PREFIX=%HB_INSTALL_PREFIX%
if "%_HB_INSTALL_PREFIX%" == "" set _HB_INSTALL_PREFIX=..\..
set _HB_LIB_INSTALL=%HB_LIB_INSTALL%
if "%_HB_LIB_INSTALL%" == "" set _HB_LIB_INSTALL=%_HB_INSTALL_PREFIX%\lib
if "%1" == "clean" goto POST_CLEAN
if "%1" == "Clean" goto POST_CLEAN
if "%1" == "CLEAN" goto POST_CLEAN
if "%1" == "install" goto POST_INSTALL
if "%1" == "Install" goto POST_INSTALL
if "%1" == "INSTALL" goto POST_INSTALL
:POST_BUILD
implib ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %HB_DLL_DIR%\%HB_DLL_NAME%.dll
goto POST_EXIT
:POST_CLEAN
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp > nul
if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib > nul
goto POST_EXIT
:POST_INSTALL
if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %_HB_LIB_INSTALL%
goto POST_EXIT
:POST_EXIT
set CFLAGS=
set HB_DLL_NAME=
set HB_DLL_DIR=

View File

@@ -0,0 +1,25 @@
#!/bin/sh
#
# $Id$
#
if [ "${LIBHARU_INC}" == "" ]
then
echo "---------------------------------------------------------------"
echo "IMPORTANT: You will need Haru Free PDF Library (libharu) DLL
echo " package installed and this envvar to be set to"
echo " successfully build this library:"
echo " export LIBHARU_INC=C:/libharu/include"
echo " or"
echo " export LIBHARU_INC=/usr/include/libharu"
echo "---------------------------------------------------------------"
exit 1
fi
export CFLAGS=
for I in ${LIBHARU_INC}; do
CFLAGS="${CFLAGS} -I${I}"
done
../mtpl_gcc.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
unset CFLAGS

View File

@@ -0,0 +1,63 @@
@echo off
rem
rem $Id$
rem
if not "%LIBHARU_DIR%" == "" goto DIR_OK
echo ---------------------------------------------------------------
echo IMPORTANT: You'll need Haru Free PDF Library (libharu) DLL package
echo from www.libharu.org and this envvar to be set to
echo successfully build this library:
echo set LIBHARU_DIR=-IC:\libharu
echo ---------------------------------------------------------------
goto POST_EXIT
:DIR_OK
set CFLAGS=-I%LIBHARU_DIR%\include
set HB_DLL_NAME=libhpdf
set HB_DLL_DIR=%LIBHARU_DIR%
rem ---------------------------------------------------------------
call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
rem ---------------------------------------------------------------
set _HB_INSTALL_PREFIX=%HB_INSTALL_PREFIX%
if "%_HB_INSTALL_PREFIX%" == "" set _HB_INSTALL_PREFIX=..\..
set _HB_LIB_INSTALL=%HB_LIB_INSTALL%
if "%_HB_LIB_INSTALL%" == "" set _HB_LIB_INSTALL=%_HB_INSTALL_PREFIX%\lib
if "%1" == "clean" goto POST_CLEAN
if "%1" == "Clean" goto POST_CLEAN
if "%1" == "CLEAN" goto POST_CLEAN
if "%1" == "install" goto POST_INSTALL
if "%1" == "Install" goto POST_INSTALL
if "%1" == "INSTALL" goto POST_INSTALL
:POST_BUILD
rem Use supplied .lib file.
if not exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy %LIBHARU_DIR%\%HB_DLL_NAME%.lib ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul
goto POST_EXIT
:POST_CLEAN
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib > nul
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp del ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.exp > nul
if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib > nul
goto POST_EXIT
:POST_INSTALL
if exist %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib del %_HB_LIB_INSTALL%\%HB_DLL_NAME%.lib
if exist ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib copy ..\..\lib\%_HB_CC_NAME%\%HB_DLL_NAME%.lib %_HB_LIB_INSTALL%
goto POST_EXIT
:POST_EXIT
set CFLAGS=
set HB_DLL_NAME=
set HB_DLL_DIR=

View File

@@ -0,0 +1,22 @@
@echo off
rem
rem $Id$
rem
rem ---------------------------------------------------------------
rem This is a generic template file, if it doesn't fit your own needs
rem please DON'T MODIFY IT.
rem
rem Instead, make a local copy and modify that one, or make a call to
rem this batch file from your customized one. [vszakats]
rem ---------------------------------------------------------------
set HB_BIN_INSTALL=..\..\..\bin
set HB_INC_INSTALL=..\..\..\include
set HB_LIB_INSTALL=..\..\..\lib
set HB_ARCHITECTURE=w32
set HB_COMPILER=bcc32
set HB_USER_LIBS=hbhpdf.lib libhpdf.lib hbct.lib
call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -0,0 +1,22 @@
@echo off
rem
rem $Id$
rem
rem ---------------------------------------------------------------
rem This is a generic template file, if it doesn't fit your own needs
rem please DON'T MODIFY IT.
rem
rem Instead, make a local copy and modify that one, or make a call to
rem this batch file from your customized one. [vszakats]
rem ---------------------------------------------------------------
set HB_BIN_INSTALL=..\..\..\bin
set HB_INC_INSTALL=..\..\..\include
set HB_LIB_INSTALL=..\..\..\lib
set HB_ARCHITECTURE=w32
set HB_COMPILER=msvc
set HB_USER_LIBS=hbhpdf.lib libhpdf.lib hbct.lib
call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 164 B

View File

Before

Width:  |  Height:  |  Size: 104 B

After

Width:  |  Height:  |  Size: 104 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 302 B

After

Width:  |  Height:  |  Size: 302 B

View File

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 112 B

View File

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

View File

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,6 +1,7 @@
/*
* $Id$
*/
/*
* Copyright 2008 Pritpal Bedi <pritpal@vouchcac.com>
*
@@ -45,6 +46,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
@@ -66,7 +68,7 @@
Function Main( cFileToSave )
if empty( cFileToSave )
cFileToSave := CurDrive()+'\myharu.pdf'
cFileToSave := 'myharu.pdf'
endif
if DesignHaruPDF( cFileToSave )
@@ -968,7 +970,7 @@ static function show_description( page, x, y, text )
Static function Page_CodePages( pdf )
Local page, outline, font2, font_name, root, i, font, dst, fname
Local cResPath := "c:\harbour\contrib\hbhpdf\tests\"
Local cResPath := "files\"
Local cAfm := cResPath+"a010013l.afm"
Local cPfb := cResPath+"a010013l.pfb"
Local encodings := { ;
@@ -1062,7 +1064,7 @@ static function draw_graph( page )
if (i > 0 .and. i <= 16)
HPDF_Page_BeginText(page)
HPDF_Page_MoveTextPos(page, x + 5, PAGE_HEIGHT - 75)
buf := NumToHex( i-1 )
buf := hb_NumToHex( i-1 )
HPDF_Page_ShowText(page, buf)
HPDF_Page_EndText(page)
endif
@@ -1079,7 +1081,7 @@ static function draw_graph( page )
if (i < 14)
HPDF_Page_BeginText(page)
HPDF_Page_MoveTextPos(page, 45, y + 5)
buf := NumToHex( 15-i )
buf := hb_NumToHex( 15-i )
HPDF_Page_ShowText(page, buf)
HPDF_Page_EndText(page)
endif
@@ -1279,7 +1281,7 @@ Static Function Page_Annotation( pdf )
Static function Page_Images( pdf )
Local font, page, dst, image, image1, image2, image3
Local x, y, angle, angle1, angle2, rad, rad1, rad2, iw, ih
Local cImagePath := "c:\harbour\contrib\hbhpdf\tests\"
Local cImagePath := "files\"
/* create default-font */
font := HPDF_GetFont(pdf, "Helvetica", NULL)

View File

@@ -54,6 +54,7 @@ if not "%MYSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbmysql
if not "%PGSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbpgsql
if not "%ADS_DIR%" == "" set _HB_DIRS=%_HB_DIRS% rddads
if not "%ZLIB_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbzlib
if not "%LIBHARU_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbhpdf
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
rem *******************************************************

View File

@@ -56,6 +56,7 @@ if [ "${MYSQL_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbmysql "; fi;
if [ "${PGSQL_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbpgsql "; fi;
if [ "${ZLIB_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbzlib "; fi;
if [ "${ADS_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} rddads "; fi;
if [ "${LIBHARU_INC}" != "" ]; then _HB_DIRS="${_HB_DIRS} hbhpdf "; fi;
_HB_DIRS="${_HB_DIRS} ${_HB_DIRS_ADD}"

View File

@@ -54,6 +54,7 @@ if not "%MYSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbmysql
if not "%PGSQL_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbpgsql
if not "%ADS_DIR%" == "" set _HB_DIRS=%_HB_DIRS% rddads
if not "%ZLIB_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbzlib
if not "%LIBHARU_DIR%" == "" set _HB_DIRS=%_HB_DIRS% hbhpdf
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
rem *******************************************************