PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → iTextHeight() for RTF-text
iTextHeight() for RTF-text
Débuté par Stefan Bentvelsen, 19 juin 2006 19:36 - 2 réponses
Posté le 19 juin 2006 - 19:36
Hello all,
in my program I have a routine for printing RTF-text but since WD9 I noticed a problem with calculating the height of a part of a RTF-text. I do NOT use the reportgenerator for this.
After printing a part of a RTF-text with iPrintZoneRTF(), the printing cursor is yet positioned on the startposition of the RTF-text. If I try to calculate where printing was stopped (with iTextHeight(rtftext, 150, iRTF, startposition, endposition)) because not all the available printspace is used, iTextHeight() returns always zero. Only if I do NOT use the endposition (parameter 5) I get the size til the end of the text, but in this case there is not printed til the end of the text.
Is there anybody with same experiences and how can I solve this problem ?
My code:
...
// iPrintZoneRTF returns the number of printed characters, but WITHOUT the number of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos()+10,iYPos(),iXPos()+160,iYPos()+200)
WHILE (iTotPrinted+iPrinted) iTotPrinted+=iPrinted
iSkipPage()
PrintHeader()

// iPrintZoneRTF returns the number of printed characters, but WITHOUT the NUMBER of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos()+10,iYPos(),iXPos()+160,iYPos()+200,iTotPrinted+1)
iPrinted-=iTotPrinted
rPos=iZoneHeight(SCRTF.EDIT_RTFTEXT,150,iRTF,iTotPrinted+1,iPrinted)
iYPos(iYPos()+rPos)
END
iPrint(iXPos(10)+"***** End of document *****")
iEndPrinting()

Regards, Stefan.
Posté le 19 juin 2006 - 20:51
Hello,
in addition to this problem:
In WD80, this worked OK !
Regards, Stefan
Hello all,
in my program I have a routine for printing RTF-text but since WD9 I noticed a problem with calculating the height of a part of a RTF-text. I do NOT use the reportgenerator for this.
After printing a part of a RTF-text with iPrintZoneRTF(), the printing cursor is yet positioned on the startposition of the RTF-text. If I try to calculate where printing was stopped (with iTextHeight(rtftext, 150, iRTF, startposition, endposition)) because not all the available printspace is used, iTextHeight() returns always zero. Only if I do NOT use the endposition (parameter 5) I get the size til the end of the text, but in this case there is not printed til the end of the text.
Is there anybody with same experiences and how can I solve this problem ?
My code:
...
// iPrintZoneRTF returns the number of printed characters, but WITHOUT the number of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos() 10,iYPos(),iXPos() 160,iYPos() 200)
WHILE (iTotPrinted iPrinted) > iTotPrinted =iPrinted
iSkipPage()
PrintHeader()

// iPrintZoneRTF returns the number of printed characters, but WITHOUT the NUMBER of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos() 10,iYPos(),iXPos() 160,iYPos() 200,iTotPrinted 1)
iPrinted-=iTotPrinted
rPos=iZoneHeight(SCRTF.EDIT_RTFTEXT,150,iRTF,iTotPrinted 1,iPrinted)
iYPos(iYPos() rPos)
END
iPrint(iXPos(10) "***** End of document *****")
iEndPrinting()

Regards, Stefan.
Posté le 20 juin 2006 - 12:49
Hello,
in addition to this problem:
In WD80, this worked OK !
Regards, Stefan
Hello all,
in my program I have a routine for printing RTF-text but since WD9 I noticed a problem with calculating the height of a part of a RTF-text. I do NOT use the reportgenerator for this.
After printing a part of a RTF-text with iPrintZoneRTF(), the printing cursor is yet positioned on the startposition of the RTF-text. If I try to calculate where printing was stopped (with iTextHeight(rtftext, 150, iRTF, startposition, endposition)) because not all the available printspace is used, iTextHeight() returns always zero. Only if I do NOT use the endposition (parameter 5) I get the size til the end of the text, but in this case there is not printed til the end of the text.
Is there anybody with same experiences and how can I solve this problem ?
My code:
...
// iPrintZoneRTF returns the number of printed characters, but WITHOUT the number of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos()+10,iYPos(),iXPos()+160,iYPos()+200)
WHILE (iTotPrinted+iPrinted) >> iTotPrinted+=iPrinted
iSkipPage()
PrintHeader()

// iPrintZoneRTF returns the number of printed characters, but WITHOUT the NUMBER of CR's in it !
iPrinted=iPrintZoneRTF(SCRTF.EDIT_RTFTEXT,iXPos()+10,iYPos(),iXPos()+160,iYPos()+200,iTotPrinted+1)
rPos=iZoneHeight(SCRTF.EDIT_RTFTEXT,150,iRTF,iTotPrinted+1,iPrinted)
iPrinted-=iTotPrinted
iYPos(iYPos()+rPos)
END
iPrint(iXPos(10)+"***** End of document *****")
iEndPrinting()

Regards, Stefan.