Jump to content

Wordpad problems printing RTF


simbo
 Share

Recommended Posts

I've made a program that produces RTF files. They print fine in OpenOffice.org or MS Word.

Wordpad on the other hand, ignores the page size and margin information in my RTF markup.

I can get around the margin problem by writing to the registry keys where Wordpad stores the margins from the previous session.

What I can't figure out is what to do about the page size. What I've worked out so far is that Wordpad sets the page size according to the paper size of the default printer. I've found these settings for my printer in the registry, but what can I do if I don't know which printer my users will be using?

Any suggestions (particularly outside-the-box ones!) gratefully received

Matt

Link to comment
Share on other sites

I've made a program that produces RTF files. They print fine in OpenOffice.org or MS Word.

Wordpad on the other hand, ignores the page size and margin information in my RTF markup.

I can get around the margin problem by writing to the registry keys where Wordpad stores the margins from the previous session.

What I can't figure out is what to do about the page size. What I've worked out so far is that Wordpad sets the page size according to the paper size of the default printer. I've found these settings for my printer in the registry, but what can I do if I don't know which printer my users will be using?

Any suggestions (particularly outside-the-box ones!) gratefully received

Matt

Do you mean how do you get Wordpad to use the correct page size if your user wants to use Wordpad to print your RTF file?

Will the user be running your script at the time, or could it be arranged that they will have a script of yours running at the time?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Do you mean how do you get Wordpad to use the correct page size if your user wants to use Wordpad to print your RTF file?

Will the user be running your script at the time, or could it be arranged that they will have a script of yours running at the time?

Thanks for your reply.

My script will be running the whole time.

What I want is for my user to be able to print my RTF file using the correct page size. I decided to use Wordpad and RTF because all Windows computers have it, but I'm open to other suggestions.

I appreciate that this is not an RTF forum, but just for info, I used \paperh and \paperw and I'm sure this is correct because MS Word reads it perfectly.

Thanks again

Matt

Link to comment
Share on other sites

Thanks for your reply.

My script will be running the whole time.

What I want is for my user to be able to print my RTF file using the correct page size. I decided to use Wordpad and RTF because all Windows computers have it, but I'm open to other suggestions.

I appreciate that this is not an RTF forum, but just for info, I used \paperh and \paperw and I'm sure this is correct because MS Word reads it perfectly.

Thanks again

Matt

I haven't got any neat ideas. But if WordPad uses the paper size of the default printer then maybe you could automatically set the default printer to be the one the user chooses before WordPad realizes you've done it. Something like this.

Wait for the Print dialog to appear from WordPad.

Cover it immediately with your own gui which lets the user choose the printer to use, page numbers etc.

When the user clicks the print button on your false gui set the printer chosen to be the default printer.

Set the details in the real Print window using ControlCommand, ControlClick the Print button etc, then close the false print window.

Do you think that would work?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 2 weeks later...

I haven't got any neat ideas. But if WordPad uses the paper size of the default printer then maybe you could automatically set the default printer to be the one the user chooses before WordPad realizes you've done it. Something like this.

Wait for the Print dialog to appear from WordPad.

Cover it immediately with your own gui which lets the user choose the printer to use, page numbers etc.

When the user clicks the print button on your false gui set the printer chosen to be the default printer.

Set the details in the real Print window using ControlCommand, ControlClick the Print button etc, then close the false print window.

Do you think that would work?

Thanks Martin.

Yes, I think that could work. I'll play around and do something along these lines.

Many thanks for your help

Matt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...