[Gambas-user] Working printsample with more than one page

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Feb 3 15:57:25 CET 2016


Hi Roel,

The way printing is managed in Gambas3 is completely different in one 
way: You have to tell the number of pages beforehand, then printing runs 
automatically page for page.  There is one help page that gives a rough 
overview.

Why do you want to clear a page? Your code will have to check what to 
print on each page while it is printing, and you cannot stop until all 
pages have been printed.

In my case, the problem was how to print tables of random length. 
Gambas2 was "simple": The program just printed a table line for line, 
then initiated a new page when the table had reached the lower edge.

Now I found this solution for Gambas3: The table will start at a given 
position on the page. There are functions that I could use to measure 
the exact height of each table line. It sums up until it finds it will 
hit the lower end, then save the number of this line in a list, go on to 
the next end of page and so on... After measuring and counting, the 
number of entries in the list will tell how many pages are needed, and 
printing can be started.

I found that the new way of printing is way faster than the old one. It 
is in fact so fast that I could simply print into a temporary pdf file, 
then use this file for a preview. When the user hits OK, this pdf is 
sent to the printer.

On the other hand, I had to re-think a number of functions and when this 
will happen before that etc., and still haven't completely finished :)

Regards
Rolf

Am 03.02.2016 12:03, schrieb Roel Touwen:
> Hi all,
>
> I'm converting software from Gambas 2 to 3. Printing seems to be very
> very different in Gambas 3.
>
> Has anyone a sample of printing more pages? So also clearing the page etc.
>
> Thanks for now.
>
> Best regards,
>
> Roel
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>





More information about the User mailing list