Hello all,
I am trying to iron out my problems with printing on custom sized tractor paper (using an impact printer). Every time I print a
test page, the printer behaves as if it was loaded with tractor paper that is 11 inches long, rather then the 7 inches that the forms are on.
Before I list my code, let me explain everything that I have done. I am running Windows XP, so I went to the Printers and Faxes folder, clicked File > Server Properties, and created a custom form size (8.5" wide by 7" long with zero margins). Going back to the Printers and Faxes folder, I right clicked on the impact printer and clicked properties. From there I clicked the Device tab and selected my custom form that I had created for the tractor feed section. I then clicked the general tab and clicked the printing preferences. From there I clicked the Paper/Quality tab and selected Tractor Feed for the source. Then I clicked the advance button and selected my custom form for paper size. I also changed the resolution to 360X180.
The printer itself has hardware settings for paper size. I've went through the menu and selected 7 inches for the form length.
Now going to the code, I created the paper object and set it size to 612 for width and 504 for height. I also changed the ImageableArea to the size of the paper (which I think eliminates the margins), and set its orientation to 0, 0. I then set the paper object to the PageFormat, and used drawString to test my settings.
Program compiles fine. When I run it and click the button, I select the correct printer. I also went through the preferences to make sure that all the setting are correct (especially to make sure my custom form is selected.). The closest I can get the
string to the corner of the page is 75, 80. On the paper it measures 7/8" from the left, and 1" from the top.
I have tested my custom form settings with
word 2007. I was able to get the text on the very corner of the paper, and the printer was able to determine where the next form started. I believe that my problem lies within my code. Any help would be greatly appreciated!
Thanks!