Source language: Translate to:

Fonts and the PrintTextFile / PrintDataFile Commands

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Fonts and the PrintTextFile / PrintDataFile Commands

Postby Enigman » Tue Mar 13, 2012 9:02 am

Is it possible to control the font used with the PrintTextFile and PrintDataFile commands? My primary wish would be to simply print using the Courier New font so that digit columns are vertically aligned.

Alternatively, is it possible to use PrintPage and have it print the entire contents of a large box that has data scrolled off screen?

Also, is it possible to print the contents of a variable without writing it out to a file first?

I have an app that generates large volumes of output that I do not wish to save as an RTF file. Likewise my preference would be to not have to pre-process a text file into an RTF just to print. The overhead would be significant since the text file could be hundreds of K in size.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Neosoft Support » Tue Mar 13, 2012 10:49 am

I'm sorry, it's not currently possible to change the font used with the PrintTextFile and PrintDataFile actions.

One of the following plug-ins might solve the problem:

Editor's Toolbox:
http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=9&lid=40

Printing System 4.0:
http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=7&lid=157
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Enigman » Tue Mar 13, 2012 11:14 am

Thanks.

Two questions remain, though:
Alternatively, is it possible to use PrintPage and have it print the entire contents of a large box that has data scrolled off screen?

Also, is it possible to print the contents of a variable without writing it out to a file first?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby dpayer » Tue Mar 13, 2012 4:43 pm

Enigman wrote:Thanks.

Two questions remain, though:
Alternatively, is it possible to use PrintPage and have it print the entire contents of a large box that has data scrolled off screen?

Also, is it possible to print the contents of a variable without writing it out to a file first?


Something to think about:

You could put a text file or a string variable into a web browser object and print from there. Further more if you encapsulated it with the proper HTML formatting, you can force it to print in Courier.

David P.
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Enigman » Tue Mar 13, 2012 7:12 pm

You could put a text file or a string variable into a web browser object and print from there. Further more if you encapsulated it with the proper HTML formatting, you can force it to print in Courier.

Great suggestion, but upon testing it out, the browser doesn't react well to what I am trying to print unless it is previously line broken. If it isn't, the browser doesn't wrap the unbroken line. Interestingly, when the output is line broken the browser defaults to the Courier New font. I can alter all this with embedded HTML code, but, I cannot get to the page format dialog to modify the print header and footer, and the default choices are not so hot.

I would be better off to write the print data out as an HTML file and then call the external default browser, which is a possibility.

As it is now I can programmatically alter the header and footer for the PrintTextFile command. Somewhere is a table of RTF codes I could add to the file, but I was hoping to do the print without using a unique or temporary external file.

Did you say you knew a way to push a page into the browser using only a variable?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Postby Neosoft Support » Wed Mar 14, 2012 11:06 am

Alternatively, is it possible to use PrintPage and have it print the entire contents of a large box that has data scrolled off screen?


No, the PrintPage action prints exactly what you see on the screen.

Also, is it possible to print the contents of a variable without writing it out to a file first?


Not with NeoBook, but it looks like the Printing System plug-in can do that:

http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=7&lid=157

There is also the NeoPrintHTML plug-in which can print HTML files:

http://www.neosoftware.com/neobook/modules/plugins/singlefile.php?cid=7&lid=141

HTML is much easier than RTF, so that might be a good option.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Enigman » Wed Mar 14, 2012 11:37 am

HTML is much easier than RTF, so that might be a good option.

Normally, yes, but in this application RTF is less code than HTML. All I want to do is turn on Courier New as the font. That only requires a couple of lines in the top and some \par tags. And the browser object does not give me access to the header and footer setup dialog, while PrintTextfile does.

I mentioned above that maybe I would just output an HTML file and call the default browser, but I just realized that the browser might cache the page despite HTML commands to the contrary, and I cannot have that. This app is intended to operate quietly without external files and leave little to no trace of it's existence. I cannot leave encrypted data behind in a cache by accident. That is why I didn't want to use a temporary file for printing. As it is now, the user would have had to have already made the choice to save the encryption locally before printing would be available.

Likewise I do not want to use any plug-ins so I can keep the EXE size down, and so I do not have a situation like I have had I in the past where a plug-in is suddenly no longer supported or operational at some future time.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests