Page 3 of 5

Re: Printing - Page number paradox

Posted: Wed Oct 26, 2016 4:01 am
by bpd2000
Pablo César wrote: Our C Guru.
+1
Rathinagiri wrote:That is unbelievable! :)
+1

Re: Printing - Page number paradox

Posted: Wed Oct 26, 2016 1:10 pm
by dragancesu
Perfect,
yet to make search box in PREVIEW window
P.S. One was written to be

Printing - Page number paradox

Posted: Wed Oct 26, 2016 1:44 pm
by Pablo César
Nice idea Dragan.

Would be perfect for string search at metafiles... wow !

Re: Printing - Page number paradox

Posted: Wed Oct 26, 2016 2:05 pm
by srvet_claudio
dragancesu wrote:Perfect,
yet to make search box in PREVIEW window
P.S. One was written to be
It is possible to find and replace a text in a emf. I go to prepare a demo.

Re: Printing - Page number paradox

Posted: Wed Oct 26, 2016 3:24 pm
by Rathinagiri
If the printing option is without preview what will be the situation?

Even at that time EMF files are created?

Re: Printing - Page number paradox

Posted: Wed Oct 26, 2016 10:04 pm
by srvet_claudio
Rathinagiri wrote:If the printing option is without preview what will be the situation?

Even at that time EMF files are created?
EMF files are generated internally only in preview mode, but it could to force the generation of files in other modes.

Re: Printing - Page number paradox

Posted: Thu Mar 16, 2017 10:29 pm
by Karl
Hi Claudio,
Thanks for your fabulous code. Sorry, I´m a very new member in this forum. The problem with the pages has been occupying me for a long time. I work with RICHEDITBOX and there is no PRINTDOC or PRINTPAGE as you can see in the following code. But I found printing twice is a fine way and very fast. The second pass avoids the whole printer-dialog and you have only to push the leave-button (Icon "door)" after the first pass, if pages are greater than 1. Now I´m looking for a routine which will push this button automatically. Not knowing about the source code of the Preview window I need your help. It would be great.

Thanks in advance from Ulm-Germany :D
Karl

***************************** Beginn Auftrag-Druck *************************
FUNCTION AuftragDruck
PRIVATE page := 0, ;
pages := 1, ;
lSuccess := .F.

SELECT PRINTER DIALOG TO lSuccess PREVIEW
IF lSuccess
aSelRange := {0,-1}
PrintPageCodeBlock := {||page += 1, @ 0,0 PRINT AuftragsKopf()}
Form_81.Edit_1.RTFPrint (aSelRange, 13, 95, 10, 75, PrintPageCodeBlock)
pages := page
IF pages > 1
page := 0
aSelRange := {0,-1}
PrintPageCodeBlock := {||page += 1, @ 0,0 PRINT AuftragsKopf()}
Form_81.Edit_1.RTFPrint (aSelRange, 13, 95, 10, 75, PrintPageCodeBlock)
ENDIF
ELSE
MsgInfo('Drucker nicht bereit !')
ENDIF
RETURN NIL

PROCEDURE AuftragsKopf()
LOCAL b_Font := "Arial", ;
b_Size := 7, ;
c_Font := "Times New Roman", ;
c_Size := 12

@ 0,0 PRINT IMAGE 'versauf' ;
WIDTH 210 ;
HEIGHT 297

IF pages > 1
@ 28,70 PRINT 'Seite ' + STR(page, 3) + ' von ' + STR(pages, 3) FONT c_Font SIZE c_Size
ELSE
@ 28,70 PRINT 'Seite 1 von 1' FONT c_Font SIZE c_Size
ENDIF
@ 19.5,112 PRINT 'Kennzeichen' FONT b_Font SIZE b_Size
@ 22 ,112 PRINT ken1 + ' - ' + ken2 + ' ' + ken3 FONT c_Font SIZE c_Size
@ 19.5,158 PRINT 'Fahrg.-Nr.' FONT b_Font SIZE b_Size
@ 22 ,158 PRINT fgnr FONT c_Font SIZE c_Size
RETURN NIL[/size]
****************************** Ende Auftrag-Druck **************************

Re: Printing - Page number paradox

Posted: Fri Mar 17, 2017 7:53 am
by serge_girard
Thx Karl and welcome from Belgium!

Serge

Re: Printing - Page number paradox

Posted: Wed Mar 29, 2017 5:44 pm
by Pablo César
Hi Karl, have you be welcome to our community.

Sorry I did not understand you regarding button, pages.

I translated your short code but I did not understood.

Would you be so kind to prepare a workable short exemple of what you are talking ?

By preference to be a short demo in English that I can compile and would be perfect if you embrace your source code in CODE tags. (Here for CODE tags - Brief tutorial)

I am interested to know how you do. :)
 
srvet_claudio wrote: Wed Oct 26, 2016 2:05 pm
dragancesu wrote:Perfect,
yet to make search box in PREVIEW window
P.S. One was written to be
It is possible to find and replace a text in a emf. I go to prepare a demo.
Claudio, have you already prepared a demo ?

I'm waiting for that. :)

Re: Printing - Page number paradox

Posted: Wed Mar 29, 2017 8:42 pm
by srvet_claudio
Pablo César wrote: Wed Mar 29, 2017 5:44 pm Claudio, have you already prepared a demo ?

I'm waiting for that. :)
When I have time I will do