HardMarginX and HardMarginY and print preview...

I have been working on using print preview for my app and have successfully been able to view my drawings wherever I want by creating a database with the Avery Label specs in it and calling the coordinates from that data....

Here is the problem.....I draw the rectange of the label onto the print doc literally and it shows in print preview perfect......so I hit print and it is off!!!!

So I researched the hardmarginx and hardmarginy properties of the printer and now in my printdoc paint procedure I offset the drawing with THESE values and it prints perfect! BUT the print preview is off now the value of the hardmargins...... ANY CLUE how I can have my cake and eat it too?

It appears that printeres are different also in this hardmargin value....I have watched the values change based on the printer I have selected......like I said I now have PERFECT printing but the preview is off the value of the hardmargin..... hmmmm.......... I am ALL ears for a solution..!!!!

Thanks in advance.

[1025 byte] By [virnoche] at [2007-12-24]
# 1

Awe come on pro's................SOMEONE must have noticed this!? How Can I get the printpreview and the printer to do the SAME thing?

They are off the difference in harmarginx and harmarginy.....maybe this is a bug? If I draw so that the printpreview looks right it is off on the printer......If I draw so it is right on the printer the printpreview is off..........

virnoche at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2

I have also this problem, when setting up the PaperSize in a printapplication the HardMarginX change by itself without me wanting it. And then I cannot change it back.

Have you solved this problem or is it a bug in .Net?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=308895&SiteID=1

BR

Rikard

Rikard at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3

I can't believe this! You have described my exact problem! I too cannot get the preview and the printer to match. When I draw a rectangle representing the margins, the preview looks perfect but the printed page is out of alignment to the right by about 50 pixels. I was willing to put up with inconsistencies but the coordinates that I specify does not align on "some" other computers. Have you found a solution yet? I don't want to pay my retirement to microsoft for an answer.

Thanks a million!

RicherTextBox

RicherTextBox at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
virnoche wrote:

I have been working on using print preview for my app and have successfully been able to view my drawings wherever I want by creating a database with the Avery Label specs in it and calling the coordinates from that data....

Here is the problem.....I draw the rectange of the label onto the print doc literally and it shows in print preview perfect......so I hit print and it is off!!!!

So I researched the hardmarginx and hardmarginy properties of the printer and now in my printdoc paint procedure I offset the drawing with THESE values and it prints perfect! BUT the print preview is off now the value of the hardmargins...... ANY CLUE how I can have my cake and eat it too?

It appears that printeres are different also in this hardmargin value....I have watched the values change based on the printer I have selected......like I said I now have PERFECT printing but the preview is off the value of the hardmargin..... hmmmm.......... I am ALL ears for a solution..!!!!

Thanks in advance.

Can't you change the "offset" based on whether you are printpreview or printing?

TaDa at 2007-8-31 > top of Msdn Tech,Visual Basic,Visual Basic General...