2008-05-20 13:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
+ contrib/hbvpdf
+ contrib/hbvpdf/common.mak
+ contrib/hbvpdf/hbvpdf.prg
+ contrib/hbvpdf/hbvpdf.ch
+ contrib/hbvpdf/make_gcc.sh
+ contrib/hbvpdf/tests
+ contrib/hbvpdf/tests/fonts.dat
+ contrib/hbvpdf/tests/files
+ contrib/hbvpdf/tests/files/color.tif
+ contrib/hbvpdf/tests/files/test.txt
+ contrib/hbvpdf/tests/files/color.jpg
+ contrib/hbvpdf/tests/pdf_demo.prg
+ contrib/hbvpdf/tests/tstpdf.prg
+ contrib/hbvpdf/tests/bld_b32.bat
+ contrib/hbvpdf/tests/bld_vc.bat
+ contrib/hbvpdf/hbvpdft.prg
+ contrib/hbvpdf/make_b32.bat
+ contrib/hbvpdf/make_vc.bat
+ contrib/hbvpdf/Makefile
+ Added Viktor K's pure Clipper pdf lib.
+ Added Pritpal's OOP version.
+ Added make files, reorged dir layout, named
files to avoid collision.
+ Added minor #define tweak to compile as-is.
* Renamed pdf.ch to hbvpdf.ch for above reasons,
if this hurts anybody, I will correct it.
! Fixed unused vars and a few other things.
; TOFIX: - ShellExecute(), GetDeskTopWindow()
dependencies commented out.
- fonts.dat dependency is a PITA, so
this file should be moved inside
the .prg somehow.
- There are some hard-wired non porable
things like acrobat executable path.
* contrib/Makefile
* contrib/make_b32_all.bat
* contrib/make_gcc_all.sh
* contrib/make_vc_all.bat
+ hbvpdf added to make systems.
This commit is contained in:
@@ -8,6 +8,48 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-05-20 13:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
+ contrib/hbvpdf
|
||||
+ contrib/hbvpdf/common.mak
|
||||
+ contrib/hbvpdf/hbvpdf.prg
|
||||
+ contrib/hbvpdf/hbvpdf.ch
|
||||
+ contrib/hbvpdf/make_gcc.sh
|
||||
+ contrib/hbvpdf/tests
|
||||
+ contrib/hbvpdf/tests/fonts.dat
|
||||
+ contrib/hbvpdf/tests/files
|
||||
+ contrib/hbvpdf/tests/files/color.tif
|
||||
+ contrib/hbvpdf/tests/files/test.txt
|
||||
+ contrib/hbvpdf/tests/files/color.jpg
|
||||
+ contrib/hbvpdf/tests/pdf_demo.prg
|
||||
+ contrib/hbvpdf/tests/tstpdf.prg
|
||||
+ contrib/hbvpdf/tests/bld_b32.bat
|
||||
+ contrib/hbvpdf/tests/bld_vc.bat
|
||||
+ contrib/hbvpdf/hbvpdft.prg
|
||||
+ contrib/hbvpdf/make_b32.bat
|
||||
+ contrib/hbvpdf/make_vc.bat
|
||||
+ contrib/hbvpdf/Makefile
|
||||
+ Added Viktor K's pure Clipper pdf lib.
|
||||
+ Added Pritpal's OOP version.
|
||||
+ Added make files, reorged dir layout, named
|
||||
files to avoid collision.
|
||||
+ Added minor #define tweak to compile as-is.
|
||||
* Renamed pdf.ch to hbvpdf.ch for above reasons,
|
||||
if this hurts anybody, I will correct it.
|
||||
! Fixed unused vars and a few other things.
|
||||
; TOFIX: - ShellExecute(), GetDeskTopWindow()
|
||||
dependencies commented out.
|
||||
- fonts.dat dependency is a PITA, so
|
||||
this file should be moved inside
|
||||
the .prg somehow.
|
||||
- There are some hard-wired non porable
|
||||
things like acrobat executable path.
|
||||
|
||||
* contrib/Makefile
|
||||
* contrib/make_b32_all.bat
|
||||
* contrib/make_gcc_all.sh
|
||||
* contrib/make_vc_all.bat
|
||||
+ hbvpdf added to make systems.
|
||||
|
||||
2008-05-20 09:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* contrib/hbwhat32/wincorec.c
|
||||
! Removed old-style Clipper comment from C code.
|
||||
|
||||
@@ -11,6 +11,7 @@ DIRS=\
|
||||
hbmisc \
|
||||
hbnf \
|
||||
hbclipsm \
|
||||
hbvpdf \
|
||||
xhb \
|
||||
# examples \
|
||||
# hbzlib \
|
||||
|
||||
16
harbour/contrib/hbvpdf/Makefile
Normal file
16
harbour/contrib/hbvpdf/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
ROOT = ../../
|
||||
|
||||
PRG_SOURCES=\
|
||||
hbvpdf.prg \
|
||||
hbvpdft.prg \
|
||||
|
||||
PRG_HEADERS=\
|
||||
hbvpdf.ch \
|
||||
|
||||
LIBNAME=hbvpdf
|
||||
|
||||
include $(TOP)$(ROOT)config/lib.cf
|
||||
17
harbour/contrib/hbvpdf/common.mak
Normal file
17
harbour/contrib/hbvpdf/common.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
LIBNAME = $(LIBPREF)hbvpdf
|
||||
|
||||
LIB_PATH = $(LIB_DIR)$(LIBNAME)$(LIBEXT)
|
||||
|
||||
PRG_HEADERS = \
|
||||
hbvpdf.ch \
|
||||
|
||||
LIB_OBJS = \
|
||||
$(OBJ_DIR)hbvpdf$(OBJEXT) \
|
||||
$(OBJ_DIR)hbvpdft$(OBJEXT) \
|
||||
|
||||
all: \
|
||||
$(LIB_PATH) \
|
||||
223
harbour/contrib/hbvpdf/hbvpdf.ch
Normal file
223
harbour/contrib/hbvpdf/hbvpdf.ch
Normal file
@@ -0,0 +1,223 @@
|
||||
#include "fileio.ch"
|
||||
#include "common.ch"
|
||||
|
||||
#define CRLF chr(13)+chr(10)
|
||||
|
||||
#define NORMAL 0
|
||||
#define BOLD 1
|
||||
#define ITALIC 2
|
||||
#define BOLDITALIC 3
|
||||
|
||||
#define BOOKLEVEL 1
|
||||
#define BOOKTITLE 2
|
||||
#define BOOKPARENT 3
|
||||
#define BOOKPREV 4
|
||||
#define BOOKNEXT 5
|
||||
#define BOOKFIRST 6
|
||||
#define BOOKLAST 7
|
||||
#define BOOKCOUNT 8
|
||||
#define BOOKPAGE 9
|
||||
#define BOOKCOORD 10
|
||||
|
||||
#define FONTNAME 1 // font name
|
||||
#define FONTSIZE 2 // font size
|
||||
#define LPI 3 // lines per inch
|
||||
#define PAGESIZE 4 // page size
|
||||
#define PAGEORIENT 5 // page orientation
|
||||
#define PAGEX 6
|
||||
#define PAGEY 7
|
||||
#define REPORTWIDTH 8 // report width
|
||||
#define REPORTPAGE 9 // report page
|
||||
#define REPORTLINE 10 // report line
|
||||
#define FONTNAMEPREV 11 // prev font name
|
||||
#define FONTSIZEPREV 12 // prev font size
|
||||
#define PAGEBUFFER 13 // page buffer
|
||||
#define REPORTOBJ 14 // current obj
|
||||
#define DOCLEN 15 // document length
|
||||
#define TYPE1 16 // array of type 1 fonts
|
||||
#define MARGINS 17 // recalc margins ?
|
||||
#define HEADEREDIT 18 // edit header ?
|
||||
#define NEXTOBJ 19 // next obj
|
||||
#define PDFTOP 20 // top row
|
||||
#define PDFLEFT 21 // left & right margin in mm
|
||||
#define PDFBOTTOM 22 // bottom row
|
||||
#define HANDLE 23 // handle
|
||||
#define PAGES 24 // array of pages
|
||||
#define REFS 25 // array of references
|
||||
#define BOOKMARK 26 // array of bookmarks
|
||||
#define HEADER 27 // array of headers
|
||||
#define FONTS 28 // array of report fonts
|
||||
#define IMAGES 29 // array of report images
|
||||
#define PAGEIMAGES 30 // array of current page images
|
||||
#define PAGEFONTS 31 // array of current page fonts
|
||||
#define FONTWIDTH 32 // array of fonts width's
|
||||
#define OPTIMIZE 33 // optimized ?
|
||||
#define PARAMLEN 33 // number of report elements
|
||||
|
||||
#define ALIGN_LEFT 1
|
||||
#define ALIGN_CENTER 2
|
||||
#define ALIGN_RIGHT 3
|
||||
#define ALIGN_JUSTIFY 4
|
||||
|
||||
#define IMAGE_WIDTH 1
|
||||
#define IMAGE_HEIGHT 2
|
||||
#define IMAGE_XRES 3
|
||||
#define IMAGE_YRES 4
|
||||
#define IMAGE_BITS 5
|
||||
#define IMAGE_FROM 6
|
||||
#define IMAGE_LENGTH 7
|
||||
|
||||
#define BYTE 1
|
||||
#define ASCII 2
|
||||
#define SHORT 3
|
||||
#define LONG 4
|
||||
#define RATIONAL 5
|
||||
#define SBYTE 6
|
||||
#define UNDEFINED 7
|
||||
#define SSHORT 8
|
||||
#define SLONG 9
|
||||
#define SRATIONAL 10
|
||||
#define FLOAT 11
|
||||
#define DOUBLE 12
|
||||
|
||||
#define pdf_ALICEBLUE "F0F8FF"
|
||||
#define pdf_ANTIQUEWHITE "FAEBD7"
|
||||
#define pdf_AQUA "00FFFF"
|
||||
#define pdf_AQUAMARINE "7FFFD4"
|
||||
#define pdf_AZURE "F0FFFF"
|
||||
#define pdf_BEIGE "F5F5DC"
|
||||
#define pdf_BISQUE "FFE4C4"
|
||||
#define pdf_BLACK "000000"
|
||||
#define pdf_BLANCHEDALMOND "FFEBCD"
|
||||
#define pdf_BLUE "0000FF"
|
||||
#define pdf_BLUEVIOLET "8A2BE2"
|
||||
#define pdf_BROWN "A52A2A"
|
||||
#define pdf_BURLYWOOD "DEB887"
|
||||
#define pdf_CADETBLUE "5F9EA0"
|
||||
#define pdf_CHARTREUSE "7FFF00"
|
||||
#define pdf_CHOCOLATE "D2691E"
|
||||
#define pdf_CORAL "FF7F50"
|
||||
#define pdf_CORNFLOWERBLUE "6495ED"
|
||||
#define pdf_CORNSILK "FFF8DC"
|
||||
#define pdf_CRIMSON "DC143C"
|
||||
#define pdf_CYAN "00FFFF"
|
||||
#define pdf_DARKBLUE "00008B"
|
||||
#define pdf_DARKCYAN "008B8B"
|
||||
#define pdf_DARKGOLDENROD "B8860B"
|
||||
#define pdf_DARKGRAY "A9A9A9"
|
||||
#define pdf_DARKGREEN "006400"
|
||||
#define pdf_DARKKHAKI "BDB76B"
|
||||
#define pdf_DARKMAGENTA "8B008B"
|
||||
#define pdf_DARKOLIVEGREEN "556B2F"
|
||||
#define pdf_DARKORANGE "FF8C00"
|
||||
#define pdf_DARKORCHID "9932CC"
|
||||
#define pdf_DARKRED "8B0000"
|
||||
#define pdf_DARKSALMON "E9967A"
|
||||
#define pdf_DARKSEAGREEN "8FBC8F"
|
||||
#define pdf_DARKSLATEBLUE "483D8B"
|
||||
#define pdf_DARKSLATEGRAY "2F4F4F"
|
||||
#define pdf_DARKTURQUOISE "00CED1"
|
||||
#define pdf_DARKVIOLET "9400D3"
|
||||
#define pdf_DEEPPINK "FF1493"
|
||||
#define pdf_DEEPSKYBLUE "00BFFF"
|
||||
#define pdf_DIMGRAY "696969"
|
||||
#define pdf_DODGERBLUE "1E90FF"
|
||||
#define pdf_FIREBRICK "B22222"
|
||||
#define pdf_FLORALWHITE "FFFAF0"
|
||||
#define pdf_FORESTGREEN "228B22"
|
||||
#define pdf_FUCHSIA "FF00FF"
|
||||
#define pdf_GAINSBORO "DCDCDC"
|
||||
#define pdf_GHOSTWHITE "F8F8FF"
|
||||
#define pdf_GOLD "FFD700"
|
||||
#define pdf_GOLDENROD "DAA520"
|
||||
#define pdf_GRAY "808080"
|
||||
#define pdf_GREEN "008000"
|
||||
#define pdf_GREENYELLOW "ADFF2F"
|
||||
#define pdf_HONEYDEW "F0FFF0"
|
||||
#define pdf_HOTPINK "FF69B4"
|
||||
#define pdf_INDIANRED "CD5C5C"
|
||||
#define pdf_INDIGO "4B0082"
|
||||
#define pdf_IVORY "FFFFF0"
|
||||
#define pdf_KHAKI "F0E68C"
|
||||
#define pdf_LAVENDER "E6E6FA"
|
||||
#define pdf_LAVENDERBLUSH "FFF0F5"
|
||||
#define pdf_LAWNGREEN "7CFC00"
|
||||
#define pdf_LEMONCHIFFON "FFFACD"
|
||||
#define pdf_LIGHTBLUE "ADD8E6"
|
||||
#define pdf_LIGHTCORAL "F08080"
|
||||
#define pdf_LIGHTCYAN "E0FFFF"
|
||||
#define pdf_LIGHTGOLDENRODYELLOW "FAFAD2"
|
||||
#define pdf_LIGHTGREEN "90EE90"
|
||||
#define pdf_LIGHTGREY "D3D3D3"
|
||||
#define pdf_LIGHTPINK "FFB6C1"
|
||||
#define pdf_LIGHTSALMON "FFA07A"
|
||||
#define pdf_LIGHTSEAGREEN "20B2AA"
|
||||
#define pdf_LIGHTSKYBLUE "87CEFA"
|
||||
#define pdf_LIGHTSLATEGRAY "778899"
|
||||
#define pdf_LIGHTSTEELBLUE "B0C4DE"
|
||||
#define pdf_LIGHTYELLOW "FFFFE0"
|
||||
#define pdf_LIME "00FF00"
|
||||
#define pdf_LIMEGREEN "32CD32"
|
||||
#define pdf_LINEN "FAF0E6"
|
||||
#define pdf_MAGENTA "FF00FF"
|
||||
#define pdf_MAROON "800000"
|
||||
#define pdf_MEDIUMAQUAMARINE "66CDAA"
|
||||
#define pdf_MEDIUMBLUE "0000CD"
|
||||
#define pdf_MEDIUMORCHID "BA55D3"
|
||||
#define pdf_MEDIUMPURPLE "9370DB"
|
||||
#define pdf_MEDIUMSEAGREEN "3CB371"
|
||||
#define pdf_MEDIUMSLATEBLUE "7B68EE"
|
||||
#define pdf_MEDIUMSPRINGGREEN "00FA9A"
|
||||
#define pdf_MEDIUMTURQUOISE "48D1CC"
|
||||
#define pdf_MEDIUMVIOLETRED "C71585"
|
||||
#define pdf_MIDNIGHTBLUE "191970"
|
||||
#define pdf_MINTCREAM "F5FFFA"
|
||||
#define pdf_MISTYROSE "FFE4E1"
|
||||
#define pdf_MOCCASIN "FFE4B5"
|
||||
#define pdf_NAVAJOWHITE "FFDEAD"
|
||||
#define pdf_NAVY "000080"
|
||||
#define pdf_OLDLACE "FDF5E6"
|
||||
#define pdf_OLIVE "808000"
|
||||
#define pdf_OLIVEDRAB "6B8E23"
|
||||
#define pdf_ORANGE "FFA500"
|
||||
#define pdf_ORANGERED "FF4500"
|
||||
#define pdf_ORCHID "DA70D6"
|
||||
#define pdf_PALEGOLDENROD "EEE8AA"
|
||||
#define pdf_PALEGREEN "98FB98"
|
||||
#define pdf_PALETURQUOISE "AFEEEE"
|
||||
#define pdf_PALEVIOLETRED "DB7093"
|
||||
#define pdf_PAPAYAWHIP "FFEFD5"
|
||||
#define pdf_PEACHPUFF "FFDAB9"
|
||||
#define pdf_PERU "CD853F"
|
||||
#define pdf_PINK "FFC0CB"
|
||||
#define pdf_PLUM "DDADDD"
|
||||
#define pdf_POWDERBLUE "B0E0E6"
|
||||
#define pdf_PURPLE "800080"
|
||||
#define pdf_RED "FF0000"
|
||||
#define pdf_ROSYBROWN "BC8F8F"
|
||||
#define pdf_ROYALBLUE "4169E1"
|
||||
#define pdf_SADDLEBROWN "8B4513"
|
||||
#define pdf_SALMON "FA8072"
|
||||
#define pdf_SANDYBROWN "F4A460"
|
||||
#define pdf_SEAGREEN "2E8B57"
|
||||
#define pdf_SEASHELL "FFF5EE"
|
||||
#define pdf_SIENNA "A0522D"
|
||||
#define pdf_SILVER "C0C0C0"
|
||||
#define pdf_SKYBLUE "87CEEB"
|
||||
#define pdf_SLATEBLUE "6A5ACD"
|
||||
#define pdf_SLATEGRAY "708090"
|
||||
#define pdf_SNOW "FFFAFA"
|
||||
#define pdf_SPRINGGREEN "00FF7F"
|
||||
#define pdf_STEELBLUE "4682B4"
|
||||
#define pdf_TAN "D2B48C"
|
||||
#define pdf_TEAL "008080"
|
||||
#define pdf_THISTLE "D8BFD8"
|
||||
#define pdf_TOMATO "FF6347"
|
||||
#define pdf_TURQUOISE "40E0D0"
|
||||
#define pdf_VIOLET "EE82EE"
|
||||
#define pdf_WHEAT "F5DEB3"
|
||||
#define pdf_WHITE "FFFFFF"
|
||||
#define pdf_WHITESMOKE "F5F5F5"
|
||||
#define pdf_YELLOW "FFFF00"
|
||||
#define pdf_YELLOWGREEN "9ACD32"
|
||||
|
||||
2624
harbour/contrib/hbvpdf/hbvpdf.prg
Normal file
2624
harbour/contrib/hbvpdf/hbvpdf.prg
Normal file
File diff suppressed because it is too large
Load Diff
2649
harbour/contrib/hbvpdf/hbvpdft.prg
Normal file
2649
harbour/contrib/hbvpdf/hbvpdft.prg
Normal file
File diff suppressed because it is too large
Load Diff
6
harbour/contrib/hbvpdf/make_b32.bat
Normal file
6
harbour/contrib/hbvpdf/make_b32.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
rem
|
||||
rem $Id$
|
||||
rem
|
||||
|
||||
call ..\mtpl_b32.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
7
harbour/contrib/hbvpdf/make_gcc.sh
Normal file
7
harbour/contrib/hbvpdf/make_gcc.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
../mtpl_gcc.sh $1 $2 $3 $4 $5 $6 $7 $8 $9
|
||||
6
harbour/contrib/hbvpdf/make_vc.bat
Normal file
6
harbour/contrib/hbvpdf/make_vc.bat
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
rem
|
||||
rem $Id$
|
||||
rem
|
||||
|
||||
call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
22
harbour/contrib/hbvpdf/tests/bld_b32.bat
Normal file
22
harbour/contrib/hbvpdf/tests/bld_b32.bat
Normal 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=hbvpdf.lib
|
||||
|
||||
call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
22
harbour/contrib/hbvpdf/tests/bld_vc.bat
Normal file
22
harbour/contrib/hbvpdf/tests/bld_vc.bat
Normal 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=hbvpdf.lib
|
||||
|
||||
call %HB_BIN_INSTALL%\bld.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
BIN
harbour/contrib/hbvpdf/tests/files/color.jpg
Normal file
BIN
harbour/contrib/hbvpdf/tests/files/color.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
BIN
harbour/contrib/hbvpdf/tests/files/color.tif
Normal file
BIN
harbour/contrib/hbvpdf/tests/files/color.tif
Normal file
Binary file not shown.
12
harbour/contrib/hbvpdf/tests/files/test.txt
Normal file
12
harbour/contrib/hbvpdf/tests/files/test.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
(sample text)
|
||||
|
||||
THE HARBOUR PROJECT CONTRIB LICENSE
|
||||
===================================
|
||||
|
||||
There is no one single license that applies to the Harbour Project
|
||||
contrib files. Some files use the Harbour Project Compiler license.
|
||||
Some files use the Harbour Project Library license. Some files use
|
||||
the old Harbour Project Library license. Some files may even use other
|
||||
types of free software or open source software licenses. Some files
|
||||
have been donated to the public domain. If you use any of the contrib
|
||||
files, you need to investigate the license that applies to each file.
|
||||
BIN
harbour/contrib/hbvpdf/tests/fonts.dat
Normal file
BIN
harbour/contrib/hbvpdf/tests/fonts.dat
Normal file
Binary file not shown.
224
harbour/contrib/hbvpdf/tests/pdf_demo.prg
Normal file
224
harbour/contrib/hbvpdf/tests/pdf_demo.prg
Normal file
@@ -0,0 +1,224 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbvpdf.ch"
|
||||
|
||||
memvar aReport
|
||||
|
||||
procedure main()
|
||||
|
||||
local cRun, nWidth, nTab, nI, nJ, nK, nCol, nRow, aStyle, aFonts
|
||||
local nTop, nLeft, nBottom, nRight
|
||||
local aColor := { ;
|
||||
"FF0000", "8B0000", "800000", "FF4500", "D2691E", "B8860B", "FF8C00", "FFA500", "DAA520", "808000", "FFD700", "FFFF00", "ADFF2F", "9ACD32", "7FFF00", "7CFC00", "00FF00", "32CD32", "008000", "006400",;
|
||||
"66CDAA", "7FFFD4", "87CEFA", "87CEEB", "F0F8FF", "E0FFFF", "B0C4DE", "B0E0E6", "AFEEEE", "ADD8E6", "8FBC8F", "90EE90", "98FB98", "00FA9A", "00FF7F", "3CB371", "2E8B57", "228B22", "556B2F", "6B8E23",;
|
||||
"5F9EA0", "40E0D0", "48D1CC", "00CED1", "20B2AA", "008B8B", "008080", "2F4F4F", "00BFFF", "00FFFF", "00FFFF", "0000FF", "0000CD", "00008B", "000080", "1E90FF", "4169E1", "4682B4", "6495ED", "7B68EE",;
|
||||
"C71585", "FF1493", "FF00FF", "FF00FF", "9370DB", "DDADDD", "DB7093", "FF69B4", "DA70D6", "EE82EE", "BA55D3", "9932CC", "8A2BE2", "9400D3", "8B008B", "800080", "4B0082", "191970", "483D8B", "6A5ACD",;
|
||||
"DC143C", "B22222", "A52A2A", "CD5C5C", "FA8072", "E9967A", "FFA07A", "F5DEB3", "FFDEAD", "EEE8AA", "FFDAB9", "FFE4C4", "FFEFD5", "FFE4E1", "FFE4B5", "D2B48C", "DEB887", "F0E68C", "BDB76B", "F4A460",;
|
||||
"FDF5E6", "FFF8DC", "FAF0E6", "FAFAD2", "FFFACD", "FFEBCD", "FFFFE0", "FAEBD7", "FFF5EE", "FFF0F5", "D8BFD8", "FFC0CB", "FFB6C1", "BC8F8F", "F08080", "FF7F50", "FF6347", "8B4513", "A0522D", "CD853F",;
|
||||
"FFFAFA", "FFFFF0", "E6E6FA", "FFFAF0", "F8F8FF", "F0FFF0", "F5F5DC", "F0FFFF", "F5FFFA", "708090", "778899", "F5F5F5", "DCDCDC", "D3D3D3", "C0C0C0", "A9A9A9", "808080", "696969", "000000", "FFFFFF"}
|
||||
|
||||
PUBLIC aReport := array( PARAMLEN )
|
||||
|
||||
set date format "YYYY/MM/DD" // important for save/load array function!!!
|
||||
|
||||
aStyle := { "Normal", "Bold", "Italic", "BoldItalic" }
|
||||
|
||||
aFonts := { { "Times", .t., .t., .t., .t. },;
|
||||
{ "Helvetica", .t., .t., .t., .t. },;
|
||||
{ "Courier", .t., .t., .t., .t. } }
|
||||
|
||||
pdfOpen('test.pdf', 200, .t.)
|
||||
|
||||
pdfEditOnHeader()
|
||||
pdfImage( 'files\color.tif', 0, 0, "M" ) // file, row, col, units, height, width
|
||||
pdfEditOffHeader()
|
||||
pdfSaveHeader('test.hea')
|
||||
pdfCloseHeader()
|
||||
|
||||
pdfBookOpen()
|
||||
|
||||
/*
|
||||
pdfCreateHeader( "letter_portrait_6.hea", "LETTER", "P", 6 )
|
||||
pdfCreateHeader( "letter_portrait_8.hea", "LETTER", "P", 8 )
|
||||
pdfCreateHeader( "letter_landscape_6.hea", "LETTER", "L", 6 )
|
||||
pdfCreateHeader( "letter_landscape_8.hea", "LETTER", "L", 8 )
|
||||
pdfCreateHeader( "legal_portrait_6.hea", "LEGAL", "P", 6 )
|
||||
pdfCreateHeader( "legal_portrait_8.hea", "LEGAL", "P", 8 )
|
||||
pdfCreateHeader( "legal_landscape_6.hea", "LEGAL", "L", 6 )
|
||||
pdfCreateHeader( "legal_landscape_8.hea", "LEGAL", "L", 8 )
|
||||
*/
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
|
||||
pdfBookAdd( "Grids & Borders", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "Simple Grid", 2, aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
for nI := 0 to 792 step 36
|
||||
pdfBox( nI, 0, nI, 612, 0.01, , "D" )
|
||||
next
|
||||
for nI := 0 to 612 step 36
|
||||
pdfBox( 0, nI, 792, nI, 0.01, , "D" )
|
||||
next
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "10 dots border ", 2, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBox( 0, 0, 792, 612, 10, , "D" )
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Boxes", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "Boxes", 2, aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
nRow := 85
|
||||
nCol := 85
|
||||
pdfBox( nRow , ( nCol * 2 ) , ( nRow * 3 ) , ( nCol * 4 ) , 1.00, 15, "D" )
|
||||
pdfBox( nRow + 10, ( nCol * 2 ) + 10, ( nRow * 3 ) + 10, ( nCol * 4 ) + 10, 0.50, 25, "D" )
|
||||
pdfBox( nRow + 20, ( nCol * 2 ) + 20, ( nRow * 3 ) + 20, ( nCol * 4 ) + 20, 0.25, 35, "D" )
|
||||
pdfBox( nRow + 30, ( nCol * 2 ) + 30, ( nRow * 3 ) + 30, ( nCol * 4 ) + 30, 0.15, 45, "D" )
|
||||
pdfBox( nRow + 40, ( nCol * 2 ) + 40, ( nRow * 3 ) + 40, ( nCol * 4 ) + 40, 0.10, 55, "D" )
|
||||
pdfBox( nRow + 50, ( nCol * 2 ) + 50, ( nRow * 3 ) + 50, ( nCol * 4 ) + 50, 0.05, 65, "D" )
|
||||
pdfBox( nRow + 60, ( nCol * 2 ) + 60, ( nRow * 3 ) + 60, ( nCol * 4 ) + 60, 0.01, 75, "D" )
|
||||
pdfBox( nRow + 70, ( nCol * 2 ) + 70, ( nRow * 3 ) + 70, ( nCol * 4 ) + 70, 0.01, 85, "D" )
|
||||
pdfBox( nRow + 80, ( nCol * 2 ) + 80, ( nRow * 3 ) + 80, ( nCol * 4 ) + 80, 0.01, 95, "D" )
|
||||
pdfBox( nRow + 90, ( nCol * 2 ) + 90, ( nRow * 3 ) + 90, ( nCol * 4 ) + 90, 0.01, 100, "D" )
|
||||
|
||||
/*
|
||||
nRow := 12
|
||||
nCol := 120
|
||||
for nI := 1 to 6
|
||||
nRow += 10
|
||||
nCol += 10
|
||||
pdfBox( nCol, nRow, nCol + 10, nRow + 10, 0.5, nI, "M" )
|
||||
next
|
||||
for nI := 0 to 20 step 10
|
||||
nRow += 10
|
||||
nCol += 10
|
||||
pdfBox( nCol, nRow, nCol + 10, nRow + 10, 0.5, nI,"M" )
|
||||
next
|
||||
for nI := 30 to 100 step 10
|
||||
nRow += 10
|
||||
nCol -= 10
|
||||
pdfBox( nCol, nRow, nCol + 10, nRow + 10, 0.5, nI,"M" )
|
||||
next
|
||||
*/
|
||||
|
||||
for nI := 1 to 7
|
||||
nRow := 150 + nI * 10
|
||||
for nJ := 1 to 20
|
||||
nCol := nJ * 10 - 3
|
||||
pdfBox( nRow, nCol, nRow + 10, nCol + 10, 0.01, nI * 10,"M", chr(253) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 1, 2 ), 16) ) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 3, 2 ), 16) ) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 5, 2 ), 16) ) )
|
||||
next
|
||||
next
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Color Boxes ", 2, aReport[ REPORTPAGE ], 0 )
|
||||
for nI := 1 to 140
|
||||
nTop := ( nI - 1 ) * 2.4
|
||||
nLeft := ( nI - 1 ) * 2.1
|
||||
nBottom := aReport[ PAGEY ] - ( nI - 1 ) * 2.47
|
||||
nRight := aReport[ PAGEX ] - ( nI - 1 ) * 2.18
|
||||
pdfBox1( nTop, nLeft, nBottom, nRight, 10, chr( cton( substr( aColor[ nI ], 1, 2 ), 16) ) + chr( cton( substr( aColor[ nI ], 3, 2 ), 16) ) + chr( cton( substr( aColor[ nI ], 5, 2 ), 16) ))
|
||||
next
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBox1( 0, 0, 100, 200, 10, chr(0) + chr(255) + chr(0), chr(255) + chr(255) + chr(0) )
|
||||
pdfBookAdd( "Memos", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "Different Styles & Colors", 2, aReport[ REPORTPAGE ], 0 )
|
||||
nWidth := 90
|
||||
nTab := 0
|
||||
|
||||
pdfText( memoread('files\test.txt'), 28, 107.95, nWidth, nTab, 3, 'M', chr(253) + chr(0) + chr(0) + chr(255) )//, pdfTextCount( memoread('test.txt'), 28, 107.95, nWidth, nTab, 3, 'M' )
|
||||
pdfText( memoread('files\test.txt'), 58, 107.95, nWidth, nTab, 2, 'M', chr(253) + chr(0) + chr(255) + chr(0) )//, pdfTextCount( memoread('test.txt'), 58, 107.95, nWidth, nTab, 2, 'M' )
|
||||
pdfText( memoread('files\test.txt'), 88, 107.95, nWidth, nTab, 1, 'M', chr(253) + chr(255) + chr(0) + chr(0) )//, pdfTextCount( memoread('test.txt'), 88, 107.95, nWidth, nTab, 1, 'M' )
|
||||
pdfText( memoread('files\test.txt'), 118, 107.95 - nWidth / 2, nWidth, nTab, 4, 'M', chr(253) + chr(255) + chr(255) + chr(0) )//, pdfTextCount( memoread('test.txt'), 118, 107.95 - nWidth / 2, nWidth, nTab, 4, 'M' )
|
||||
|
||||
pdfText( memoread('files\test.txt'), 34, 100, nWidth, nTab, 3, 'R', chr(253) + chr(0) + chr(128) + chr(128) )//, pdfTextCount( memoread('test.txt'), 33, 100, nWidth, nTab, 3, 'R' )
|
||||
pdfText( memoread('files\test.txt'), 41, 100, nWidth, nTab, 2, 'R', chr(253) + chr(0) + chr(191) + chr(255) )//, pdfTextCount( memoread('test.txt'), 40, 100, nWidth, nTab, 2, 'R' )
|
||||
pdfText( memoread('files\test.txt'), 48, 100, nWidth, nTab, 1, 'R', chr(253) + chr(244) + chr(164) + chr(96) )//, pdfTextCount( memoread('test.txt'), 47, 100, nWidth, nTab, 1, 'R' )
|
||||
pdfText( memoread('files\test.txt'), 55, 35, nWidth, nTab, 4, 'R', chr(253) + chr(0) + chr(0) + chr(0) )//, pdfTextCount( memoread('test.txt'), 54, 35, nWidth, nTab, 4, 'R' )
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Fonts", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "Different Styles", 2, aReport[ REPORTPAGE ], 0 )
|
||||
nK := 6
|
||||
for nI := 1 to len( aFonts )
|
||||
++nK
|
||||
for nJ := 1 to 4
|
||||
if aFonts[ nI ][ nJ + 1 ]
|
||||
pdfSetFont( aFonts[ nI ][ 1 ], nJ - 1, aReport[ FONTSIZE ] )
|
||||
pdfRJust("This is a test for " + aFonts[ nI ][ 1 ] + " " + ;
|
||||
aStyle[ nJ ], nK++, aReport[ REPORTWIDTH ], "R")
|
||||
endif
|
||||
next
|
||||
pdfRJust(pdfUnderline("Underline"), nK++, aReport[ REPORTWIDTH ], "R")
|
||||
pdfRJust(pdfReverse("Test"), nK, aReport[ REPORTWIDTH ], "R")
|
||||
next
|
||||
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Pictures", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "TIFF", 2, aReport[ REPORTPAGE ], 0 )
|
||||
pdfImage( 'files\color.tif', 0, 0, "M" ) // file, row, col, units, height, width
|
||||
pdfRJust(pdfUnderline("TIFF"), nK++, aReport[ REPORTWIDTH ], "R")
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "JPEG", 2, aReport[ REPORTPAGE ], 0 )
|
||||
pdfImage( 'files\color.jpg', 0, 0, "M" ) // file, row, col, units, height, width
|
||||
pdfRJust(pdfUnderline("JPEG"), nK++, aReport[ REPORTWIDTH ], "R")
|
||||
|
||||
pdfOpenHeader('test.hea')
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Headers", 1, aReport[ REPORTPAGE ], 0 )
|
||||
pdfBookAdd( "Picture Header Page 8", 2, aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
// version 0.01
|
||||
pdfAtSay( chr(253) + chr(255) + chr(0) + chr(0) + 'Red Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Picture Header Page 9", 2, aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
// version 0.01
|
||||
pdfAtSay( chr(253) + chr(0) + chr(255) + chr(0) + 'Green Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
pdfNewPage( "LETTER", "P", 6 )
|
||||
pdfBookAdd( "Picture Header Page 10", 2, aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
// version 0.01
|
||||
pdfAtSay( chr(253) + chr(0) + chr(0) + chr(255) + 'Blue Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
pdfClose()
|
||||
|
||||
// pdfFilePrint( "test.pdf" ) // print .pdf file WITHOUT opening acrobat
|
||||
|
||||
/*
|
||||
cRun := "d:\progra~2\Adobe\Acroba~2.0\Reader\AcroRd32.exe " + "test.pdf"
|
||||
|
||||
IF (!SWPRUNCMD( cRun, 0, "", ""))
|
||||
alert(" Error running Acrobat Reader.")
|
||||
break
|
||||
ENDIF
|
||||
*/
|
||||
|
||||
static function cton( cString, nBase ) // this function called only used in pdf_demo.prg
|
||||
local cTemp, nI, cChar := "", n := 0, nLen
|
||||
|
||||
nLen := len( cString )
|
||||
cTemp := ""
|
||||
for nI := nLen to 1 step -1
|
||||
cTemp += substr( cString, nI, 1 )
|
||||
next
|
||||
cTemp = upper( cTemp )
|
||||
|
||||
for nI = 1 to nLen
|
||||
cChar = substr( cTemp, nI, 1 )
|
||||
if .not. IsDigit( cChar )
|
||||
n = n + ((Asc( cChar ) - 65) + 10) * ( nBase ^ ( nI - 1 ) )
|
||||
else
|
||||
n = n + (( nBase ^ ( nI - 1 )) * val( cChar ))
|
||||
endif
|
||||
next
|
||||
|
||||
return n
|
||||
|
||||
191
harbour/contrib/hbvpdf/tests/tstpdf.prg
Normal file
191
harbour/contrib/hbvpdf/tests/tstpdf.prg
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\\
|
||||
|
||||
#include "hbvpdf.ch"
|
||||
|
||||
//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\\
|
||||
|
||||
function Main()
|
||||
|
||||
local cRun, nWidth, nTab, nI, nJ, nK, nCol, nRow, aStyle, aFonts
|
||||
local nTop, nLeft, nBottom, nRight, cText, oPdf
|
||||
local aColor := { ;
|
||||
"FF0000", "8B0000", "800000", "FF4500", "D2691E", "B8860B", "FF8C00", "FFA500", "DAA520", "808000", "FFD700", "FFFF00", "ADFF2F", "9ACD32", "7FFF00", "7CFC00", "00FF00", "32CD32", "008000", "006400",;
|
||||
"66CDAA", "7FFFD4", "87CEFA", "87CEEB", "F0F8FF", "E0FFFF", "B0C4DE", "B0E0E6", "AFEEEE", "ADD8E6", "8FBC8F", "90EE90", "98FB98", "00FA9A", "00FF7F", "3CB371", "2E8B57", "228B22", "556B2F", "6B8E23",;
|
||||
"5F9EA0", "40E0D0", "48D1CC", "00CED1", "20B2AA", "008B8B", "008080", "2F4F4F", "00BFFF", "00FFFF", "00FFFF", "0000FF", "0000CD", "00008B", "000080", "1E90FF", "4169E1", "4682B4", "6495ED", "7B68EE",;
|
||||
"C71585", "FF1493", "FF00FF", "FF00FF", "9370DB", "DDADDD", "DB7093", "FF69B4", "DA70D6", "EE82EE", "BA55D3", "9932CC", "8A2BE2", "9400D3", "8B008B", "800080", "4B0082", "191970", "483D8B", "6A5ACD",;
|
||||
"DC143C", "B22222", "A52A2A", "CD5C5C", "FA8072", "E9967A", "FFA07A", "F5DEB3", "FFDEAD", "EEE8AA", "FFDAB9", "FFE4C4", "FFEFD5", "FFE4E1", "FFE4B5", "D2B48C", "DEB887", "F0E68C", "BDB76B", "F4A460",;
|
||||
"FDF5E6", "FFF8DC", "FAF0E6", "FAFAD2", "FFFACD", "FFEBCD", "FFFFE0", "FAEBD7", "FFF5EE", "FFF0F5", "D8BFD8", "FFC0CB", "FFB6C1", "BC8F8F", "F08080", "FF7F50", "FF6347", "8B4513", "A0522D", "CD853F",;
|
||||
"FFFAFA", "FFFFF0", "E6E6FA", "FFFAF0", "F8F8FF", "F0FFF0", "F5F5DC", "F0FFFF", "F5FFFA", "708090", "778899", "F5F5F5", "DCDCDC", "D3D3D3", "C0C0C0", "A9A9A9", "808080", "696969", "000000", "FFFFFF"}
|
||||
|
||||
set date format "YYYY/MM/DD"
|
||||
|
||||
aStyle := { "Normal", "Bold", "Italic", "BoldItalic" }
|
||||
|
||||
aFonts := { { "Times", .t., .t., .t., .t. }, ;
|
||||
{ "Helvetica", .t., .t., .t., .t. }, ;
|
||||
{ "Courier", .t., .t., .t., .t. } }
|
||||
|
||||
oPdf := tPdf():New( 'test.pdf', 200, .t. )
|
||||
oPdf:EditOnHeader()
|
||||
oPdf:Image( 'files\color.tif', 0, 0, "M" )
|
||||
oPdf:EditOffHeader()
|
||||
oPdf:SaveHeader( 'test.hea' )
|
||||
oPdf:CloseHeader()
|
||||
oPdf:BookOpen()
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Grids & Borders", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "Simple Grid", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
for nI := 0 to 792 step 36
|
||||
oPdf:Box( nI, 0, nI, 612, 0.01, , "D" )
|
||||
next
|
||||
for nI := 0 to 612 step 36
|
||||
oPdf:Box( 0, nI, 792, nI, 0.01, , "D" )
|
||||
next
|
||||
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "10 dots border ", 2, 2, 0 )
|
||||
oPdf:Box( 0, 0, 792, 612, 10, , "D" )
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Boxes", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "Boxes", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
nRow := 85
|
||||
nCol := 85
|
||||
oPdf:Box( nRow , ( nCol * 2 ) , ( nRow * 3 ) , ( nCol * 4 ) , 1.00, 15, "D" )
|
||||
oPdf:Box( nRow + 10, ( nCol * 2 ) + 10, ( nRow * 3 ) + 10, ( nCol * 4 ) + 10, 0.50, 25, "D" )
|
||||
oPdf:Box( nRow + 20, ( nCol * 2 ) + 20, ( nRow * 3 ) + 20, ( nCol * 4 ) + 20, 0.25, 35, "D" )
|
||||
oPdf:Box( nRow + 30, ( nCol * 2 ) + 30, ( nRow * 3 ) + 30, ( nCol * 4 ) + 30, 0.15, 45, "D" )
|
||||
oPdf:Box( nRow + 40, ( nCol * 2 ) + 40, ( nRow * 3 ) + 40, ( nCol * 4 ) + 40, 0.10, 55, "D" )
|
||||
oPdf:Box( nRow + 50, ( nCol * 2 ) + 50, ( nRow * 3 ) + 50, ( nCol * 4 ) + 50, 0.05, 65, "D" )
|
||||
oPdf:Box( nRow + 60, ( nCol * 2 ) + 60, ( nRow * 3 ) + 60, ( nCol * 4 ) + 60, 0.01, 75, "D" )
|
||||
oPdf:Box( nRow + 70, ( nCol * 2 ) + 70, ( nRow * 3 ) + 70, ( nCol * 4 ) + 70, 0.01, 85, "D" )
|
||||
oPdf:Box( nRow + 80, ( nCol * 2 ) + 80, ( nRow * 3 ) + 80, ( nCol * 4 ) + 80, 0.01, 95, "D" )
|
||||
oPdf:Box( nRow + 90, ( nCol * 2 ) + 90, ( nRow * 3 ) + 90, ( nCol * 4 ) + 90, 0.01, 100, "D" )
|
||||
|
||||
for nI := 1 to 7
|
||||
nRow := 150 + nI * 10
|
||||
for nJ := 1 to 20
|
||||
nCol := nJ * 10 - 3
|
||||
oPdf:Box( nRow, nCol, nRow + 10, nCol + 10, 0.01, nI * 10,"M", chr(253) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 1, 2 ), 16) ) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 3, 2 ), 16) ) + chr( cton( substr( aColor[ ( nI - 1 ) * 20 + nJ ], 5, 2 ), 16) ) )
|
||||
next
|
||||
next
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Color Boxes ", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
for nI := 1 to 140
|
||||
nTop := ( nI - 1 ) * 2.4
|
||||
nLeft := ( nI - 1 ) * 2.1
|
||||
nBottom := oPdf:aReport[ PAGEY ] - ( nI - 1 ) * 2.47
|
||||
nRight := oPdf:aReport[ PAGEX ] - ( nI - 1 ) * 2.18
|
||||
oPdf:Box1( nTop, nLeft, nBottom, nRight, 10, chr( cton( substr( aColor[ nI ], 1, 2 ), 16) ) + chr( cton( substr( aColor[ nI ], 3, 2 ), 16) ) + chr( cton( substr( aColor[ nI ], 5, 2 ), 16) ))
|
||||
next
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Memos", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "Different Styles & Colors", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
nWidth := 90
|
||||
nTab := 0
|
||||
cText := memoread('files\test.txt')
|
||||
|
||||
oPdf:Text( cText, 28, 107.95, nWidth, nTab, 3, 'M', chr(253) + chr(0) + chr(0) + chr(255) )
|
||||
oPdf:Text( cText, 58, 107.95, nWidth, nTab, 2, 'M', chr(253) + chr(0) + chr(255) + chr(0) )
|
||||
oPdf:Text( cText, 88, 107.95, nWidth, nTab, 1, 'M', chr(253) + chr(255) + chr(0) + chr(0) )
|
||||
oPdf:Text( cText, 118, 107.95 - nWidth / 2, nWidth, nTab, 4, 'M', chr(253) + chr(255) + chr(255) + chr(0) )
|
||||
|
||||
oPdf:Text( cText, 34, 100, nWidth, nTab, 3, 'R', chr(253) + chr(0) + chr(128) + chr(128) )//, pdfTextCount( memoread('files\test.txt'), 33, 100, nWidth, nTab, 3, 'R' )
|
||||
oPdf:Text( cText, 41, 100, nWidth, nTab, 2, 'R', chr(253) + chr(0) + chr(191) + chr(255) )//, pdfTextCount( memoread('files\test.txt'), 40, 100, nWidth, nTab, 2, 'R' )
|
||||
oPdf:Text( cText, 48, 100, nWidth, nTab, 1, 'R', chr(253) + chr(244) + chr(164) + chr(96) )//, pdfTextCount( memoread('files\test.txt'), 47, 100, nWidth, nTab, 1, 'R' )
|
||||
oPdf:Text( cText, 55, 35, nWidth, nTab, 4, 'R', chr(253) + chr(0) + chr(0) + chr(0) )//, pdfTextCount( memoread('files\test.txt'), 54, 35, nWidth, nTab, 4, 'R' )
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Fonts", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "Different Styles", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
nK := 6
|
||||
for nI := 1 to len( aFonts ) // Fonts
|
||||
++nk
|
||||
for nJ := 1 to 4 // Styles
|
||||
if aFonts[ nI ][ nJ + 1 ]
|
||||
oPdf:SetFont( aFonts[ nI ][ 1 ], nJ - 1, oPdf:aReport[ FONTSIZE ] )
|
||||
oPdf:RJust("This is a test for " + aFonts[ nI ][ 1 ] + " " + ;
|
||||
aStyle[ nJ ], nK++, oPdf:aReport[ REPORTWIDTH ], "R")
|
||||
endif
|
||||
next
|
||||
oPdf:RJust(oPdf:Underline("Underline"), nK++, oPdf:aReport[ REPORTWIDTH ], "R")
|
||||
oPdf:RJust(oPdf:Reverse("Test"), nK, oPdf:aReport[ REPORTWIDTH ], "R")
|
||||
next
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Pictures", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "TIFF", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
// file, row, col, units, height, width
|
||||
oPdf:Image( 'files\color.tif', 0, 0, "M" )
|
||||
oPdf:RJust( oPdf:Underline("TIFF"), nK++, oPdf:aReport[ REPORTWIDTH ], "R")
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "JPEG", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:Image( 'files\color.jpg', 0, 0, "M" ) // file, row, col, units, height, width
|
||||
oPdf:RJust(oPdf:Underline("JPEG"), nK++, oPdf:aReport[ REPORTWIDTH ], "R")
|
||||
|
||||
oPdf:OpenHeader('test.hea')
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Headers", 1, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
oPdf:BookAdd( "Picture Header Page 8", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
oPdf:AtSay( chr(253) + chr(255) + chr(0) + chr(0) + 'Red Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Picture Header Page 9", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
oPdf:AtSay( chr(253) + chr(0) + chr(255) + chr(0) + 'Green Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
oPdf:NewPage( "LETTER", "P", 6 )
|
||||
oPdf:BookAdd( "Picture Header Page 10", 2, oPdf:aReport[ REPORTPAGE ], 0 )
|
||||
|
||||
oPdf:AtSay( chr(253) + chr(0) + chr(0) + chr(255) + 'Blue Sample of header repeating on pages 8-10', 1, 20, "R" )
|
||||
|
||||
oPdf:Close()
|
||||
|
||||
#ifndef __XPP__
|
||||
oPdf:Execute( 'test.pdf' )
|
||||
#endif
|
||||
|
||||
// oPdf:FilePrint()
|
||||
|
||||
return nil
|
||||
|
||||
//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\\
|
||||
//
|
||||
// This function called only used in tstPdf.prg
|
||||
//
|
||||
static function cton( cString, nBase )
|
||||
local cTemp, nI, cChar := "", n := 0, nLen
|
||||
|
||||
nLen := len( cString )
|
||||
cTemp := ""
|
||||
for nI := nLen to 1 step -1
|
||||
cTemp += substr( cString, nI, 1 )
|
||||
next
|
||||
cTemp = upper( cTemp )
|
||||
|
||||
for nI = 1 to nLen
|
||||
cChar = substr( cTemp, nI, 1 )
|
||||
if .not. IsDigit( cChar )
|
||||
n = n + ((Asc( cChar ) - 65) + 10) * ( nBase ^ ( nI - 1 ) )
|
||||
else
|
||||
n = n + (( nBase ^ ( nI - 1 )) * val( cChar ))
|
||||
endif
|
||||
next
|
||||
|
||||
return n
|
||||
|
||||
//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\\
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ rem *******************************************************
|
||||
set _HB_DIRS=rddado hbbmcdx hbbtree gtwvg hbct hbgt hbmisc hbnf hbmsql
|
||||
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
set _HB_DIRS=hbole hbziparch hbodbc hbtpathy hbtip hbw32 hbwhat32 xhb
|
||||
set _HB_DIRS=hbole hbziparch hbodbc hbtpathy hbtip hbvpdf hbw32 hbwhat32 xhb
|
||||
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
set _HB_DIRS=hbclipsm hbw32ddr
|
||||
|
||||
@@ -38,7 +38,7 @@ fi
|
||||
|
||||
#**************************************************************
|
||||
|
||||
_HB_DIRS="hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmsql hbnf hbtip hbtpathy xhb"
|
||||
_HB_DIRS="hbbmcdx hbbtree hbclipsm hbct hbgt hbmisc hbmsql hbnf hbtip hbtpathy hbvpdf xhb"
|
||||
|
||||
case "$HB_ARCHITECTURE" in
|
||||
w32|cyg|os2)
|
||||
|
||||
@@ -42,7 +42,7 @@ rem *******************************************************
|
||||
set _HB_DIRS=rddado hbbmcdx hbbtree gtwvg hbct hbgt hbmisc hbnf hbmsql
|
||||
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
set _HB_DIRS=hbole hbziparch hbodbc hbtpathy hbtip hbw32 hbwhat32 xhb
|
||||
set _HB_DIRS=hbole hbziparch hbodbc hbtpathy hbtip hbvpdf hbw32 hbwhat32 xhb
|
||||
for %%n in ( %_HB_DIRS% ) do %COMSPEC% /c %__BATWORKER__% %%n %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
|
||||
set _HB_DIRS=hbclipsm hbw32ddr
|
||||
|
||||
Reference in New Issue
Block a user