Printing with PrintDocument, PrintPreviewDialog C #

1

I'm trying to print labels of my products right from my application.

But I can not reduce the size of the paper in the print, so I'm missing 1 label for every 1 print I make, follows the photo:

MyPreviewDialogshowsthatthepaperreallyisbiggerthanitshould:Followthepicture:

Icannotfixitforprinting,doesanyonepleasehaveasolution?Followmycodesofar:

privatevoidbtnPreview_Click(objectsender,EventArgse){DVprintPreviewDialog1.Document=DVprintDocument1;DVprintPreviewDialog1.ShowDialog();}privatevoidDVprintDocument1_PrintPage(objectsender,System.Drawing.Printing.PrintPageEventArgse){Bitmapbmp=Properties.Resources.logo;ImagenewImage=bmp;e.Graphics.DrawImage(newImage,10,3,newImage.Width,newImage.Height);e.Graphics.DrawString("TESTE", new Font("Arial", 12, FontStyle.Bold), Brushes.Black, new Point(130, 13));
    }
    
asked by anonymous 04.11.2016 / 15:56

1 answer

0

PROBLEM SOLVED!

I just set the Settings on the property, as in the Code below: The values in%% is an account: All sizes are converted from MM to INCHES and then multiplied by 100.

In my case, I rounded the value, but my tag has 1 "x 3". An A4 for example would have ("A4", 827, 1170);

      DVprintDocument1.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("TAM DA MINHA ETIQUETA", 300, 90);

Hugs

    
04.11.2016 / 16:54