How can I insert a pagefeed or newpage in this
Posted
#1
(In Topic #356)
Enthusiast

Code (gambas)
- ' Gambas class file
- iCkNumber = iStartCkNum
- iStartCkNum += 3
- Paint.DrawRichText(iCkNumber, 480, 25 + ix)
- Paint.DrawrichText("<b>John Doe JR.</b><br> 1234 Main Sr. <br>Hometown Il 66152", 210, 35 + ix)
- Paint.DrawrichText("<u>Date______________________ </u>", 390, 65 + ix)
- Paint.DrawrichText("<small>Pay to the<br><u>order of:</u></small><u>_______________________________________________________________|</u>", 190, 80 + ix)
- Paint.DrawrichText("<h3>$<u>________________</u></h3> ", 472, 88 + ix)
- Paint.DrawrichText("<u>______________________________________________________________________________<small>Dollars</small></u>", 190, 120 + ix)
- Paint.DrawRichText(mircnumber, 197, 200 + ix)
- Inc iCkNumber
- Next 'ix
- ' need page feed here
Posted
Regular

Posted
Enthusiast

jornmo said
Try by using gb.pdf
I am not smart enough to know how to implement that
could you give an example ?
I have tried :
Paint.DrawRichText(Chr$(12))
did not work :x
also tried :
Paint.DrawRichText(gb.pdf)
gave an error of unknown …. pdf
Posted
Regular

Take a look at the farm. Should be an example there.
Posted
Enthusiast

It would be nice to learn how to implement a page brake.
In the meantime I have a lot to learn about Gambas.
Posted
Regular

grayghost4 said
…It would be nice to learn how to implement a page brake…
I don't think you need a page-break for a modern printer.
The key to this is that the printer prints on a new page every time you tell it to print (i.e. via the Printer_Draw event). So to print several pages, use Printer.Count & Printer.Page to control your program so that the Printer_Draw() event fires for each page that you require.
Unfortunately I'm having all sorts of Gambas printer problems, but these are not really related to your question. However, take a look at this test code (which uses Paint.DrawText because of my problems):-
Code (gambas)
This works except it prints blank pages the 1st time I press the button, but then it prints both pages on subsequent presses OK. I hope this at least gives you the idea that you print pages based upon page count & number.
Posted
Guru

Posted
Regular

cogier said
Gerry Buzolic's book - Gambas from Zip
…I notice it contains 2 programs on printing. I hope it helps.
Its a great book, but it doesn't deal with pagination.
Key comments in the Gambas Documentation include: /comp/gb.qt4/printer/.begin - Gambas Documentation
Posted
Enthusiast

Thanks for the listing you put up… Got it working with :
Printer1.Count = inumofpages
That works kinda like a For Next loop
and in my case I don't need paint.fill
1 guest and 0 members have just viewed this.


