User Tools

Site Tools


changing_20the_20document_20name

Changing the document name

by Richard Russell, April 2010

When you output to a printer from a BBC BASIC program the 'document name' is set to BBC BASIC output. The principal purpose of this name is to identify the print job in the Print Manager's list of queued documents. For example if you need to delete the document from the queue you can identify it using this name.

Normally the users of your program will never be aware of the document name and there should be no need to change it. However when printing to a PDF file (see Creating PDF files) the name may be used as the default file name; in that case it might be desirable to set it to something different.

To change the document name call the procedure PROCstartdoc before you output the first character to the printer. The required document name should be supplied as the parameter of the procedure, for example:

         *PRINTER DoPDF v7
         *MARGINS 10,10,10,10
         VDU 2
         PROCstartdoc("New document name")
         PRINT "The quick brown fox jumps over the lazy dog."
         VDU 1,12,3
         END

The startdoc procedure itself is as follows:

         DEF PROCstartdoc(docname$)
         LOCAL docinfo{}
         DIM docinfo{cbSize%, lpszDocName%, lpszOutput%, lpszDatatype%, fwType%}
         docname$ += CHR$0
         docinfo.cbSize% = DIM(docinfo{})
         docinfo.lpszDocName% = !^docname$
 
         SYS "StartDoc", @prthdc%, docinfo{} TO @vdu%!-4
         SYS "StartPage", @prthdc%
         IF @vdu%!-16 SYS "SelectObject", @prthdc%, @vdu%!-16
         SYS "SetBkMode", @prthdc%, 1
         ENDPROC
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
changing_20the_20document_20name.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1