See changelog 2000-10-07 21:15 GMT -3
This commit is contained in:
@@ -41,29 +41,28 @@
|
||||
PDF *szPDFFile;
|
||||
#define FONTBOLD "Courier-Bold"
|
||||
#define FONTNORMAL "Courier"
|
||||
#define FONTSIZE 10.0
|
||||
#define FONTSIZE 10.0/*10.0*/
|
||||
#define FONTSIZEBOLD 15.0
|
||||
#define FONTSIZESMALL 10.0
|
||||
#define FONTSIZESMALL 10.0 /*10.0*/
|
||||
#define FONTSIZETABLE 8.5
|
||||
#define LEAD ((int) (FONTSIZESMALL * 1.0))
|
||||
#define LEADLINK ((int) (FONTSIZESMALL * 1.2))
|
||||
#define LEADLINK ((int) (FONTSIZESMALL * 1.3))
|
||||
#define LEADTABLE ((int) (FONTSIZESMALL * 1.2))
|
||||
float iRow=800;
|
||||
float fOldPos;
|
||||
static float iRow=800;
|
||||
static float fOldPos;
|
||||
static float iWidth;
|
||||
static float iCol;
|
||||
int sziFontBold=0;
|
||||
int sziFont=0;
|
||||
int iPage=1;
|
||||
static int sziFontBold=0;
|
||||
static int sziFont=0;
|
||||
static int iPage=1;
|
||||
static ULONG uiLen;
|
||||
static ULONG uiCount;
|
||||
static BOOL bTItems;
|
||||
static BOOL bFItems;
|
||||
|
||||
BOOL hb_checkRow(float iLine);
|
||||
PHB_ITEM pArray=NULL;
|
||||
float hb_checkStringWidth(const char *szString);
|
||||
float hb_pdfGetHeight(const char *szText);
|
||||
void hb_ProcessTableItem(PHB_ITEM p1,PHB_ITEM p2,PHB_ITEM p3,PHB_ITEM p4);
|
||||
static float hb_checkStringWidth(const char *szString);
|
||||
static float hb_pdfGetHeight(const char *szText);
|
||||
static void hb_ProcessTableItem(PHB_ITEM p1,PHB_ITEM p2,PHB_ITEM p3,PHB_ITEM p4);
|
||||
|
||||
HB_FUNC(HB_PDFNEW)
|
||||
{
|
||||
@@ -113,7 +112,7 @@ HB_FUNC(HB_PDFWRITEBOLDTEXT)
|
||||
|
||||
szTextT=(char *) hb_parc(1);
|
||||
|
||||
if (iRow<=50) {
|
||||
if (iRow<=40) {
|
||||
iRow=800;
|
||||
PDF_end_page(szPDFFile);
|
||||
sziFont = PDF_findfont(szPDFFile, FONTNORMAL, "host", 0);
|
||||
@@ -130,7 +129,7 @@ HB_FUNC(HB_PDFWRITEBOLDTEXT1)
|
||||
{
|
||||
const char *szTextT;
|
||||
szTextT=(char *) hb_parc(1);
|
||||
if (iRow<=50) {
|
||||
if (iRow<=40) {
|
||||
|
||||
iRow=800;
|
||||
PDF_end_page(szPDFFile);
|
||||
@@ -148,7 +147,7 @@ HB_FUNC(HB_PDFWRITETEXT)
|
||||
{
|
||||
const char *szTextT;
|
||||
szTextT=(char *) hb_parc(1);
|
||||
if (iRow<=50) {
|
||||
if (iRow<=40) {
|
||||
iRow=800;
|
||||
PDF_end_page(szPDFFile);
|
||||
sziFont = PDF_findfont(szPDFFile, FONTNORMAL, "host", 0);
|
||||
@@ -179,7 +178,7 @@ HB_FUNC(HB_PDFWRITEARG)
|
||||
szTextT=(char *) hb_parc(2);
|
||||
szBTextT=(char *) hb_parc(1);
|
||||
|
||||
if (iRow<=50) {
|
||||
if (iRow<=40) {
|
||||
iRow=800;
|
||||
PDF_end_page(szPDFFile);
|
||||
sziFont = PDF_findfont(szPDFFile, FONTNORMAL, "host", 0);
|
||||
@@ -199,7 +198,7 @@ int iPagetoGo=hb_parni(2);
|
||||
const char *szLink;
|
||||
|
||||
szLink=(char *) hb_parc(1);
|
||||
if (iRow<=50) {
|
||||
if (iRow<=40) {
|
||||
iRow=800;
|
||||
PDF_end_page(szPDFFile);
|
||||
sziFont = PDF_findfont(szPDFFile, FONTNORMAL, "host", 0);
|
||||
@@ -268,7 +267,7 @@ HB_FUNC(HB_GETPAGE)
|
||||
{
|
||||
hb_retni(iPage);
|
||||
}
|
||||
BOOL hb_checkRow(float iLine)
|
||||
static BOOL hb_checkRow(float iLine)
|
||||
{
|
||||
if (iLine<=20) {
|
||||
iRow=800;
|
||||
@@ -279,11 +278,10 @@ BOOL hb_checkRow(float iLine)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
float hb_checkStringWidth(const char *szString)
|
||||
static float hb_checkStringWidth(const char *szString)
|
||||
{
|
||||
float fReturn;
|
||||
fReturn= PDF_stringwidth(szPDFFile,szString,sziFont,FONTSIZESMALL);
|
||||
|
||||
return fReturn;
|
||||
}
|
||||
HB_FUNC(HB_PDFTABLE)
|
||||
@@ -293,32 +291,29 @@ PHB_ITEM pTableItem1 ;
|
||||
PHB_ITEM pTableItem2 ;
|
||||
PHB_ITEM pTableItem3 ;
|
||||
ULONG ulPos;
|
||||
bTItems=FALSE;
|
||||
bFItems=FALSE;
|
||||
|
||||
if ( ISARRAY(3)) {
|
||||
pTableItem2 =hb_param(3,HB_IT_ARRAY);
|
||||
bTItems=TRUE;
|
||||
}
|
||||
if ( ISARRAY(4)) {
|
||||
|
||||
pTableItem3 =hb_param(4,HB_IT_ARRAY);
|
||||
bFItems=TRUE;
|
||||
}
|
||||
pTableItem =hb_param(1,HB_IT_ARRAY);
|
||||
pTableItem1 =hb_param(2,HB_IT_ARRAY);
|
||||
pTableItem2 =hb_param(3,HB_IT_ARRAY);
|
||||
pTableItem3 =hb_param(4,HB_IT_ARRAY);
|
||||
if (pTableItem2 != NULL){
|
||||
bTItems=TRUE;
|
||||
}
|
||||
if (pTableItem3 != NULL){
|
||||
bFItems=TRUE;
|
||||
}
|
||||
|
||||
for (ulPos=1;ulPos<=hb_arrayLen(pTableItem);ulPos++) {
|
||||
PHB_ITEM pTempArray ;
|
||||
PHB_ITEM pTempArray1 ;
|
||||
|
||||
iCol=iRow;
|
||||
pTempArray=hb_itemArrayGet(pTableItem,ulPos);
|
||||
pTempArray1=hb_itemArrayGet(pTableItem1,ulPos);
|
||||
if (ulPos>1){
|
||||
iCol=iRow-LEAD;
|
||||
}
|
||||
if (!bTItems || !bFItems) {
|
||||
|
||||
if (!bTItems && !bFItems) {
|
||||
/* if (ulPos<2) {
|
||||
iRow-=LEAD;
|
||||
}*/
|
||||
hb_ProcessTableItem(pTempArray,pTempArray1,NULL,NULL);
|
||||
hb_itemRelease(pTempArray);
|
||||
hb_itemRelease(pTempArray1);
|
||||
@@ -345,41 +340,74 @@ PHB_ITEM pTempArray3 ;
|
||||
hb_itemRelease(pTempArray3);
|
||||
}
|
||||
}
|
||||
|
||||
bTItems=FALSE;
|
||||
bFItems=FALSE;
|
||||
fOldPos=0;
|
||||
}
|
||||
void hb_ProcessTableItem(PHB_ITEM p1,PHB_ITEM p2,PHB_ITEM p3,PHB_ITEM p4)
|
||||
static void hb_ProcessTableItem(PHB_ITEM p1,PHB_ITEM p2,PHB_ITEM p3,PHB_ITEM p4)
|
||||
{
|
||||
ULONG ulTempPos;
|
||||
ULONG ulLen;
|
||||
float fHeight;
|
||||
float fI;
|
||||
ulLen=hb_arrayLen(p1);
|
||||
ulLen=hb_arrayLen(p1);
|
||||
for (ulTempPos=1;ulTempPos<=ulLen;ulTempPos++){
|
||||
const char *szTemp=(char *) hb_arrayGetCPtr(p1,ulTempPos);
|
||||
const char *szTemp1=(char *) hb_arrayGetCPtr(p2,ulTempPos);
|
||||
if (!bTItems || !bFItems) {
|
||||
/* if (ulTempPos>1){
|
||||
iCol-=LEAD;
|
||||
}*/
|
||||
if (!bTItems && !bFItems) {
|
||||
PDF_setfont(szPDFFile, sziFont, FONTSIZETABLE);
|
||||
PDF_show_xy(szPDFFile,szTemp,27,iRow-=LEAD);
|
||||
PDF_show_xy(szPDFFile,szTemp1,286,iRow);
|
||||
/* iRow-=LEAD;
|
||||
iCol-=LEAD;*/
|
||||
fHeight+=FONTSIZE;
|
||||
}
|
||||
if (bTItems && !bFItems) {
|
||||
const char * szTemp2=(char *) hb_arrayGetCPtr(p3,ulTempPos);
|
||||
|
||||
PDF_setfont(szPDFFile, sziFont, FONTSIZETABLE);
|
||||
PDF_show_xy(szPDFFile,szTemp,27,iRow-=LEAD);
|
||||
PDF_show_xy(szPDFFile,szTemp1,200,iRow);
|
||||
PDF_show_xy(szPDFFile,szTemp2,370,iRow);
|
||||
PDF_setfont(szPDFFile, sziFont, FONTSIZESMALL);
|
||||
PDF_show_xy(szPDFFile,szTemp,27,iCol);
|
||||
PDF_show_xy(szPDFFile,szTemp1,286,iCol);
|
||||
/* PDF_show_xy(szPDFFile,szTemp,27,iCol);
|
||||
PDF_show_xy(szPDFFile,szTemp1,200,iCol);
|
||||
PDF_show_xy(szPDFFile,szTemp2,370,iCol);
|
||||
iRow-=LEAD;
|
||||
iCol-=LEAD;
|
||||
iCol-=LEAD;**/
|
||||
fHeight+=FONTSIZE;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fOldPos==0) {
|
||||
PDF_rect(szPDFFile,25,iRow+=LEAD,510,fHeight);
|
||||
PDF_rect(szPDFFile,280,iRow,255,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
if (!bTItems && !bFItems) {
|
||||
PDF_rect(szPDFFile,25,iRow-2,510,fHeight);
|
||||
PDF_rect(szPDFFile,280,iRow-2,255,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
}
|
||||
if (bTItems && !bFItems) {
|
||||
PDF_rect(szPDFFile,25,iRow-2,510,fHeight);
|
||||
PDF_rect(szPDFFile,195,iRow-2,171,fHeight);
|
||||
PDF_rect(szPDFFile,367,iRow-2,168,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
}
|
||||
}
|
||||
else {
|
||||
PDF_rect(szPDFFile,25,iRow,510,fHeight);
|
||||
PDF_rect(szPDFFile,280,iRow,255,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
if (!bTItems && !bFItems) {
|
||||
PDF_rect(szPDFFile,25,iRow-2,510,fHeight);
|
||||
PDF_rect(szPDFFile,280,iRow-2,255,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
}
|
||||
if (bTItems && !bFItems) {
|
||||
PDF_rect(szPDFFile,25,iRow-2,510,fHeight);
|
||||
PDF_rect(szPDFFile,195,iRow-2,171,fHeight);
|
||||
PDF_rect(szPDFFile,367,iRow-2,168,fHeight);
|
||||
PDF_stroke(szPDFFile);
|
||||
fOldPos=iRow;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,16 +281,16 @@ __Accept ;R;
|
||||
__AcceptStr ;R;
|
||||
__AtPrompt ;R;
|
||||
__CopyFile ;R;
|
||||
__dbApp ;N;
|
||||
__dbContinue ;N;
|
||||
__dbCopy ;N;
|
||||
__dbApp ;S;
|
||||
__dbContinue ;R;
|
||||
__dbCopy ;S;
|
||||
__dbCopyStruct ;R;
|
||||
__dbCopyXStruct ;R;
|
||||
__dbCreate ;R;
|
||||
__dbDelim ;N;
|
||||
__dbJoin ;N;
|
||||
__dbList ;R;
|
||||
__dbLocate ;N;
|
||||
__dbLocate ;R;
|
||||
__dbPack ;R;
|
||||
__dbSDF ;N;
|
||||
__dbSort ;N;
|
||||
|
||||
@@ -59,7 +59,7 @@ FUNCTION MLCToPos() ; RETURN 0
|
||||
FUNCTION MPosToLC() ; RETURN 0
|
||||
|
||||
FUNCTION __dbApp() ; RETURN NIL
|
||||
FUNCTION __dbCopy() ; RETURN NIL
|
||||
//FUNCTION __dbCopy() ; RETURN NIL
|
||||
FUNCTION __dbDelim() ; RETURN NIL
|
||||
FUNCTION __dbJoin() ; RETURN NIL
|
||||
FUNCTION __dbSDF() ; RETURN NIL
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
MEMVAR aDirlist
|
||||
MEMVAR aDocInfo,awww,aResult
|
||||
STATIC aAlso
|
||||
STATIC aFiTable := {}
|
||||
STATIC aSiTable := {}
|
||||
STATIC lIsTable := .F.
|
||||
STATIC nCommentLen
|
||||
STATIC lEof
|
||||
STATIC aFiTable := {}
|
||||
STATIC aSiTable := {}
|
||||
STATIC aFoiTable := {}
|
||||
STATIC atiTable := {}
|
||||
STATIC nNumTableItems := 0
|
||||
@@ -742,194 +742,25 @@ RETURN nil
|
||||
*+
|
||||
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
*+
|
||||
/*
|
||||
FUNCTION GenPdfTable( oPdf )
|
||||
|
||||
LOCAL y
|
||||
LOCAL nLen2
|
||||
LOCAL x
|
||||
LOCAL nMax
|
||||
LOCAL nSpace
|
||||
LOCAL lCar := .f.
|
||||
LOCAL nMax2
|
||||
LOCAL nSpace2
|
||||
LOCAL nPos1
|
||||
LOCAL nPos2
|
||||
LOCAL LColor
|
||||
LOCAL nPos
|
||||
LOCAL aLensFItem := {}
|
||||
LOCAL aLensSItem := {}
|
||||
LOCAL cMaxItem := ''
|
||||
LOCAL nmax3
|
||||
LOCAL nmax4
|
||||
LOCAL npos3
|
||||
LOCAL npos4
|
||||
LOCAL nSpace3
|
||||
LOCAL nSpace4
|
||||
LOCAL aLensTItem := {}
|
||||
LOCAL aLensfoItem := {}
|
||||
LOCAL nLen
|
||||
FOR X := 1 TO LEN( afitable )
|
||||
IF !EMPTY( afiTable[ x ] )
|
||||
AADD( aLensFItem, LEN( afiTable[ x ] ) )
|
||||
END
|
||||
NEXT
|
||||
FOR X := 1 TO LEN( asiTable )
|
||||
IF !EMPTY( asiTable[ x ] )
|
||||
AADD( aLensSItem, LEN( asiTable[ x ] ) )
|
||||
END
|
||||
NEXT
|
||||
IF LEN( afoitable ) > 0
|
||||
FUNCTION GenPdfTable( oPdf ,nNumTableItems)
|
||||
|
||||
FOR X := 1 TO LEN( afoitable )
|
||||
IF !EMPTY( afoiTable[ x ] )
|
||||
AADD( aLensfoItem, LEN( afoiTable[ x ] ) )
|
||||
END
|
||||
NEXT
|
||||
ENDIF
|
||||
IF LEN( atitable ) > 0
|
||||
FOR X := 1 TO LEN( atitable )
|
||||
IF !EMPTY( atiTable[ x ] )
|
||||
AADD( aLenstItem, LEN( atiTable[ x ] ) )
|
||||
END
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
ASORT( aLensFItem,,, { | x, y | x > y } )
|
||||
ASORT( aLensSItem,,, { | x, y | x > y } )
|
||||
IF LEN( afoitable ) > 0 .AND. nNumTableItems == 4
|
||||
ASORT( alenstitem,,, { | x, y | x > y } )
|
||||
nmax3 := alenstitem[ 1 ]
|
||||
npos := MaxElemPdf( atitable )
|
||||
nPos3 := ASCAN( alenstitem, { | x | x == nPos } )
|
||||
|
||||
ASORT( aLensFoItem,,, { | x, y | x > y } )
|
||||
nmax4 := alensfoitem[ 1 ]
|
||||
nPos := MaxElemPdf( afoitable )
|
||||
nPos4 := ASCAN( alensfoitem, { | x | x == nPos } )
|
||||
ENDIF
|
||||
IF LEN( atitable ) > 0 .AND. nNumTableItems == 3
|
||||
ASORT( alenstitem,,, { | x, y | x > y } )
|
||||
nmax3 := alenstitem[ 1 ]
|
||||
npos := MaxElemPdf( atitable )
|
||||
nPos3 := ASCAN( alenstitem, { | x | x == nPos } )
|
||||
|
||||
ENDIF
|
||||
|
||||
nMax := aLenssItem[ 1 ]
|
||||
nPos := MaxElemPdf( asitable )
|
||||
nPos1 := ASCAN( aLenssItem, { | x | x == nPos } )
|
||||
|
||||
|
||||
|
||||
nMax2 := alensfitem[ 1 ]
|
||||
nPos := MaxElemPdf( afitable )
|
||||
nPos2 := ASCAN( alensfitem, { | x | x == nPos } )
|
||||
IF nNumTableItems == 2
|
||||
cMaxItem := ' ' + "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "»"
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "»", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "»", .F. ) //-4
|
||||
ENDIF
|
||||
ELSEIF nNumTableItems == 3
|
||||
cMaxItem := ' ' + "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "»"
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "»", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "»", .F. ) //-4
|
||||
ENDIF
|
||||
ELSEIF nNumTableItems == 4
|
||||
cMaxItem := ' ' + "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Ë" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "»"
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Ë" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "»", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "É" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ë" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ë" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Ë" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "»", .F. ) //-4
|
||||
ENDIF
|
||||
ENDIF
|
||||
FOR x := 1 TO LEN( asitable )
|
||||
IF !EMPTY( asitable[ x ] )
|
||||
nSpace := nMax - LEN( asitable[ x ] )
|
||||
nSpace2 := nMax2 - LEN( afitable[ x ] )
|
||||
|
||||
IF nNumTableItems == 2
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteTextBox( " º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º" + HB_OSNEWLINE() )
|
||||
ELSE
|
||||
hb_pdfWriteTextBox( "º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º" + HB_OSNEWLINE() )
|
||||
ENDIF
|
||||
ELSEIF nNumTableItems == 3
|
||||
nSpace3 := nMax3 - LEN( atitable[ x ] )
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteTextBox( " º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º " + atiTable[ x ] + SPACE( nspace3 ) + " º" + HB_OSNEWLINE() )
|
||||
ELSE
|
||||
hb_pdfWriteTextBox( "º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º " + atiTable[ x ] + SPACE( nspace3 ) + " º" + HB_OSNEWLINE() )
|
||||
ENDIF
|
||||
ELSEIF nNumTableItems == 4
|
||||
nSpace3 := nMax3 - LEN( atitable[ x ] )
|
||||
nSpace4 := nMax4 - LEN( afoitable[ x ] )
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteTextBox( " º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º " + atiTable[ x ] + SPACE( nspace3 ) + " º " + afoiTable[ x ] + SPACE( nspace4 ) + " º" + HB_OSNEWLINE() )
|
||||
ELSE
|
||||
hb_pdfWriteTextBox( "º " + afiTable[ x ] + SPACE( nSpace2 ) + " º " + IF( asiTable[ x ] == "|", STRTRAN( asiTable[ x ], "|", " " ), asiTable[ x ] ) + SPACE( nspace ) + " º " + atiTable[ x ] + SPACE( nspace3 ) + " º " + afoiTable[ x ] + SPACE( nspace4 ) + " º" + HB_OSNEWLINE() )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ELSE
|
||||
IF nNumTableItems == 2
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "¹", .F. )
|
||||
ELSE
|
||||
hb_pdfWriteText( "Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "¹", .F. )
|
||||
ENDIF
|
||||
ELSEIF nNumTableItems == 3
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Î" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "¹", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Î" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "¹", .F. ) //-4
|
||||
ENDIF
|
||||
|
||||
ELSEIF nNumTableItems == 4
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Î" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Î" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "¹", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "Ì" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Î" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Î" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Î" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "¹", .F. ) //-4
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
IF nNumTableItems == 2
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "¼", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "¼", .F. ) //-4
|
||||
ENDIF
|
||||
|
||||
ELSEIF nNumTableItems == 3
|
||||
IF LEN( cMaxItem ) < 76
|
||||
|
||||
hb_pdfWriteText( " È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ê" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "¼", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( " È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ê" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "¼", .F. ) //-4
|
||||
ENDIF
|
||||
|
||||
ELSEIF nNumTableItems == 4
|
||||
IF LEN( cMaxItem ) < 76
|
||||
hb_pdfWriteText( " È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ê" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Ê" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "¼", .F. ) //-4
|
||||
ELSE
|
||||
hb_pdfWriteText( "È" + REPL( "Í", aLensFitem[ nPos2 ] + 2 ) + "Ê" + REPL( "Í", alensSitem[ nPos1 ] + 2 ) + "Ê" + REPL( "Í", alensTitem[ nPos3 ] + 2 ) + "Ê" + REPL( "Í", alensfoitem[ nPos4 ] + 2 ) + "¼", .F. ) //-4
|
||||
ENDIF
|
||||
ENDIF
|
||||
if nNumTableItems <3
|
||||
HB_PDFTABLE(aFitable,aSitable)
|
||||
elseif nNumTableItems<4
|
||||
HB_PDFTABLE(aFitable,aSitable,aTitable)
|
||||
else
|
||||
HB_PDFTABLE(aFitable,aSitable,aTitable,aFoiTable)
|
||||
endif
|
||||
|
||||
|
||||
afiTable := {}
|
||||
asitable := {}
|
||||
atitable := {}
|
||||
afoitable := {}
|
||||
|
||||
RETURN Nil
|
||||
*/
|
||||
|
||||
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
*+
|
||||
*+ Function ProcPdfTable()
|
||||
@@ -939,7 +770,7 @@ RETURN Nil
|
||||
*+
|
||||
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
*+
|
||||
/*
|
||||
|
||||
FUNCTION ProcPdfTable( cBuffer, nNum )
|
||||
|
||||
LOCAL nPos
|
||||
@@ -1004,14 +835,12 @@ FUNCTION ProcPdfTable( cBuffer, nNum )
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
AADD( afiTable, RTRIM( LTRIM( cItem ) ) )
|
||||
AADD( asiTable, cItem2 )
|
||||
AADD( atiTable, cItem3 )
|
||||
AADD( afoiTable, cItem4 )
|
||||
|
||||
Formattablestring(cItem ,cItem2 ,cItem3 ,cItem4 ,nNum )
|
||||
|
||||
|
||||
|
||||
RETURN Nil
|
||||
*/
|
||||
|
||||
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
*+
|
||||
*+ Function ProcPdfDesc()
|
||||
@@ -1297,17 +1126,17 @@ FUNCTION ProcPdfDesc( cBuffer, oPdf, cStyle )
|
||||
lendTable := .t.
|
||||
ELSE
|
||||
IF LFstTableItem
|
||||
/* nNumTableItems := GetNumberofTableItems( cLine )
|
||||
ProcPdfTable( cline, nNumTableItems )*/
|
||||
nNumTableItems := GetNumberofTableItems( cLine )
|
||||
ProcPdfTable( cline, nNumTableItems )
|
||||
LFstTableItem := .f.
|
||||
ELSE
|
||||
/* ProcPdfTable( cline, nNumTableItems ) */
|
||||
ProcPdfTable( cline, nNumTableItems )
|
||||
ENDIF
|
||||
|
||||
ENDIF
|
||||
ENDDO
|
||||
IF lEndTable
|
||||
/* GenPdfTable( oPdf ) */
|
||||
GenPdfTable( oPdf ,nNumTableItems)
|
||||
LFstTableItem:=.T.
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -1538,4 +1367,145 @@ STATIC FUNCTION GetItem( cItem, nCurdoc )
|
||||
ENDIF
|
||||
RETURN lReturn
|
||||
|
||||
static Function Formattablestring(cItem,cItem2,cItem3,cItem4,nItem)
|
||||
Local aItems:={}
|
||||
Local aItems2:={}
|
||||
Local aItems3:={}
|
||||
|
||||
Local aItems4:={}
|
||||
Local nCount:=0
|
||||
Local nPos:=0
|
||||
Local nResult:=0
|
||||
Local lEndPar:=.f.
|
||||
Local cTemp:=''
|
||||
Local nLen:=Len(cItem)
|
||||
local nLen1:=Len(cItem2)
|
||||
local nLen2:=Len(cItem3)
|
||||
local nLen3:=Len(cItem4)
|
||||
Local nMaxArray:=0
|
||||
if nItem <3
|
||||
do While nLen>0
|
||||
cTemp:=substr(cItem,1,47)
|
||||
if nLen>47
|
||||
nPos:=Rat(" ",cTemp)
|
||||
endif
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem,1,nPos)
|
||||
aadd(aItems,cTemp)
|
||||
else
|
||||
aadd(aItems,cTemp)
|
||||
endif
|
||||
cItem:=strtran(cItem,cTemp,"")
|
||||
nLen:=len(cItem)
|
||||
enddo
|
||||
do While nLen1>0
|
||||
cTemp:=substr(cItem2,1,47)
|
||||
if nLen1>47
|
||||
nPos:=Rat(" ",cTemp)
|
||||
endif
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem2,1,nPos)
|
||||
aadd(aItems2,cTemp)
|
||||
else
|
||||
aadd(aItems2,cTemp)
|
||||
endif
|
||||
cItem2:=strtran(cItem2,cTemp,"")
|
||||
nLen1:=len(cItem2)
|
||||
enddo
|
||||
elseif nItem <4
|
||||
do While nLen>0
|
||||
cTemp:=substr(cItem,1,32)
|
||||
if nLen>32
|
||||
nPos:=Rat(" ",cTemp)
|
||||
endif
|
||||
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem,1,nPos)
|
||||
aadd(aItems,cTemp)
|
||||
else
|
||||
aadd(aItems,cTemp)
|
||||
endif
|
||||
cItem:=strtran(cItem,cTemp,"")
|
||||
nLen:=len(cItem)
|
||||
enddo
|
||||
do While nLen1>0
|
||||
cTemp:=substr(cItem2,1,32)
|
||||
if nLen1>32
|
||||
nPos:=Rat(" ",cTemp)
|
||||
endif
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem2,13nPos)
|
||||
aadd(aItems2,cTemp)
|
||||
else
|
||||
aadd(aItems2,cTemp)
|
||||
endif
|
||||
cItem2:=strtran(cItem2,cTemp,"")
|
||||
nLen1:=len(cItem2)
|
||||
enddo
|
||||
|
||||
endif
|
||||
if nItem <4
|
||||
do While nLen2>0
|
||||
cTemp:=substr(cItem3,1,32)
|
||||
if nLen2>32
|
||||
nPos:=Rat(" ",cTemp)
|
||||
endif
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem3,1,nPos)
|
||||
aadd(aItems3,cTemp)
|
||||
else
|
||||
aadd(aItems3,cTemp)
|
||||
endif
|
||||
cItem3:=strtran(cItem3,cTemp,"")
|
||||
nLen2:=len(cItem3)
|
||||
enddo
|
||||
endif
|
||||
do While nLen3>0
|
||||
cTemp:=substr(cItem4,1,40)
|
||||
nPos:=Rat(" ",cTemp)
|
||||
if nPos>0
|
||||
cTemp:=substr(cItem4,1,nPos)
|
||||
aadd(aItems4,cTemp)
|
||||
else
|
||||
aadd(aItems4,cTemp)
|
||||
endif
|
||||
cItem4:=strtran(cItem4,cTemp,"")
|
||||
nLen3:=len(cItem4)
|
||||
enddo
|
||||
nMaxArray:=getArray(aItems,aItems2,Aitems3,aItems4)
|
||||
|
||||
do while Len(aItems) <nMaxArray
|
||||
aadd(aitems,"")
|
||||
enddo
|
||||
do while Len(aItems2) <nMaxArray
|
||||
aadd(aitems2,"")
|
||||
enddo
|
||||
do while Len(aItems3) <nMaxArray
|
||||
aadd(aitems3,"")
|
||||
enddo
|
||||
do while Len(aItems4) <nMaxArray
|
||||
aadd(aitems4,"")
|
||||
enddo
|
||||
|
||||
aadd(aFiTable,aItems)
|
||||
aadd(aSiTable,aItems2)
|
||||
aadd(aTitable,aItems3)
|
||||
aadd(aFoiTable,aItems4)
|
||||
|
||||
return nil
|
||||
static function getArray(aItems,aItems2,Aitems3,aItems4)
|
||||
local nSize := 0
|
||||
nSize:=Len(aItems)
|
||||
if nSize<Len(aitems2)
|
||||
nSize:=Len(aItems2)
|
||||
endif
|
||||
if nSize<Len(aitems3)
|
||||
nSize:=Len(aItems3)
|
||||
endif
|
||||
if nSize<Len(aitems4)
|
||||
nSize:=Len(aItems4)
|
||||
endif
|
||||
Return nSize
|
||||
|
||||
|
||||
*+ EOF: GENNG.PRG
|
||||
|
||||
@@ -331,8 +331,8 @@ FUNCTION MAIN( cFlags, cLinkName, cAtFile )
|
||||
ProcessRtf()
|
||||
ELSEIF lPdf
|
||||
#ifdef PDF
|
||||
// ProcessPDF(.t.)
|
||||
// ProcessPDF(.f.)
|
||||
ProcessPDF(.t.)
|
||||
ProcessPDF(.f.)
|
||||
#endif
|
||||
ELSEIF lWww
|
||||
ProcessWww()
|
||||
|
||||
Reference in New Issue
Block a user