Computing.Net > Forums > Programming > Printing RTF in Batch uses Defaults

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Printing RTF in Batch uses Defaults

Reply to Message Icon

Name: Pyth007
Date: October 10, 2008 at 09:19:14 Pacific
OS: Windows XP
CPU/Ram: Various
Product: Various
Comment:

I am trying to develop a quick label making program that allows a user to scan in a machine's serial number, MAC Address, and Part number; and then generate a custom barcoded label with all three pieces of data printed on it. I thought this would be fairly easy... basically use a batch script to prompt the user to scan in the data, "echo" out an .rtf document, and then invoke "write /p 'myfile.rtf'" to print the label automatically on the label printer (set as default printer). This seems to work fine for the process, but the rtf file is not being printed using the settings stated within the rtf file itself. Rather, I needed to change both the default printer settings as well as go into wordpad and change the page setup settings as well in order for the labels to be printed correctly. If, however, I open the rtf file in Word (from Windows instead of through a batch script), the settings from the document seem to be correct (ie the scale adjusts to the paper-size as specified in the .rtf file instead of using the default paper-size). Is there a way to ensure that when the batch file opens the document in Wordpad, that it retains the correct settings? Or is there a difference between Word and Wordpad that might be causing this issue (I'd rather use Wordpad since not all of the systems that would use this script have Word installed)?

There are 10 different kinds of people in this world. Those that know binary, and those that don't.



Sponsored Link
Ads by Google

Response Number 1
Name: simbo
Date: October 15, 2008 at 15:06:05 Pacific
Reply:

Hi Pyth007.

I've been having the same problems with RTF/Wordpad. It seems bizare that Microsoft own the RTF format and yet their RTF reader doesn't read RTF properly.

Anyway, the page margin info for Wordpad is held in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad
I don't know much about batch files, but if you're able to write to the registry then that could be the answer. Don't forget to set the units too, just in case.

As for the page size, I'm still working on that, but if you come up with anything else, I'd be glad to hear about it. From what I can gather, letter is the default page size in RTF.

Regards

Matt


0
Reply to Message Icon

Related Posts

See More


Can't get file to work in... Change reg query output



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Printing RTF in Batch uses Defaults

Show size of HDD in Mb using batch www.computing.net/answers/programming/show-size-of-hdd-in-mb-using-batch/17383.html

How do U double-direct in Batch?? www.computing.net/answers/programming/how-do-u-doubledirect-in-batch/11387.html

Date Routines in Batch Files www.computing.net/answers/programming/date-routines-in-batch-files/15590.html