Hi list, the fine program printgfd.exe has been sitting on my hard disk for quite some time. I usually print graphics only with my word processor. So I did not use printgfd.exe very often, but it is good to have.
A long time ago someone on the list found out how to use that program in order to print BMP from Arachne. That time I was not entirely convinced of the results. Now, after having spent a couple of hours with the program interface and documentation I finally got the program to do what I want: It prints all virtual pages (BMPs) fitting horizontally to A4 paper on as many pages as necessary. 1. Arachne plug-in to print pages graphically ********************************************* The mime.cfg line is (everything on one line): ----------- mime.cfg -------------------------- file/printbmp.dgi |@call grafprt.bat 4prt.bmp $r \n del _4prt.bmp ----------------------------------------------- The batch file I wrote for this task is a bit complicated as Arachne's internal variable $r does not hand over the actual screen width, but the screen width in pixels minus the width of the scroll bar (is there a reason why?). The script grafprt.bat reads: ------------ grafprt.bat ------------------- @echo off rem --- 1st parameter is the name of the bitmap file --- set fname=%1 shift rem --- 2nd parameter is horizontal width of the bitmap --- rem --- scroll bar width is 10 pixel ------ for %%i in (629 640 789 800 loop640 loop800) do if "%1"=="%%i" goto %%i ---- one line! --- goto done rem --- the labels 629...800 call the program again ------ rem --- and hand over beginning of vertical sections ----- :629 :640 grafprt.bat %fname% loop640 0 700 1400 2100 2800 3500 :789 :800 grafprt.bat %fname% loop800 0 900 1800 2700 3600 4500 rem --- label loop640 prints a page <=640 pixels --- :loop640 shift if "%1"=="" goto done cls i:\appl\grafprg\printgf\printgfd.exe %fname% /AA320,%1,640,800 echo. choice "more? [y/n] " /C:NY /N if not errorlevel 2 goto done goto loop640 rem --- label loop800 prints a page <=800 pixels --- :loop800 shift if "%1"=="" goto done cls i:\appl\grafprg\printgf\printgfd.exe %fname% /AA400,%1,800,1000 echo. choice "more? [y/n] " /C:NY /N if not errorlevel 2 goto done goto loop780 :done ------------------------------------------------------- When you call printbmp.dgi (a button should be on prtbmp.ah) Arachne shells out and the program prints the first section of the screen. Then asks you if you want another section etc. The height of individual sections depends on resolution of the bitmap. Any way to improve or shorten that script? 2. Limitations ************** The solution above is restricted in several ways: a) printgfd.exe is rather slow and the printing cannot be done in the background. So it may be not a good idea to print pages during an online session. If you want to print them later offline you have to make sure that all the pictures are still in the cache. Speed can be also increased by changing the program's settings in a trade-off against print quality. b) you cannot print every page, but only those which Arachne automatically converts into "virtual pages". Virtual pages are a somehow luxury performance feature that costs precious memory and can be configured on the option page. It also requires at least 256 colour mode. The possibility to send the bitmap to a printer emerges as a spin-off of that luxury feature. Unfortunately printing will not work when needed most: on long pages that take much time to read. In those cases even high end systems will not provide the neccessary amount of memory. I wonder whether there is a way to force Arachne to create a virtual page, though I assume that the backward / forward keys and clearing the cache can be helpful. Anyway, as the length of the page grows, the memory required climbs to astronomical size. 3. Questions ************ In my understanding the main problem is that Arachne attempts to load the whole page into one giant bmp file that can be easily scrolled. This is the basic idea of virtual page. But for printing this is not necessary. A printer is able to receive data continuously. Is there a way to create virtual pages gradually from top to botton and to pipe the output to a graphical printer program? Is there a way to force Arachne to generate a virtual page? Perhaps she could create some kind of spool or swap file on the hard disk in order to extend the range of printable pages? Regards Christof Lange ________________________________________________________________ Ceskobratrska cirkev evangelicka - Betlemska kaple na Zizkove Prokopova 4/216, 130 00 Praha 3, Czech Republic Tel. (+420) 222 78 06 73 / 222 78 20 02 / 603 18 87 53 http://www.volny.cz/cce.zizkov
