![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hey, I'm confused! I have a document that I want to print to a printer. I'm using inches as my units. I got it working w/ Pixels, but my boss told me I have to use Inches instead. My question is how do you determine what the values need to be to pass to Graphics.TranslateTransform(dx,dy)? When I was using pixels I just kept adjusting them, until finally after several hours found values that seem to work. I'm printing a document and I want to rotate it 180 degrees. (I know I know, just turn the paper around..., but the paper has folds in specific places, and printer also automatically folds the paper too.) So my paper is 8.5x11 I've set Graphics.PageUnit = GraphicsUnit.Inch, and Graphics.RotateTransform(180.0F) How do I know what to put for Graphics.TranslateTransform(dx,dy)? I've tried all kinds of values and my paper is just coming up blank??? Is it the same if my paper is 8.5x14? Thanks in advance. I'm been mucking w/ this all day! |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
What you say makes sense, but I can't seem to get it to work for me. I'm printing a report. A blank page is still printing. I don't think I can use e.Graphics.DrawImage(_img, 0, 0); , as I'm not printing an image. And the Page.Draw function just accepts (Graphics, RectangleF). Here's my code. Any ideas? Private Sub Print180() Dim prtRotatePrinter As New DataDynamics.ActiveReports.Interop.SystemPrinter prtRotatePrinter.StartJob("ActiveReports Document") prtRotatePrinter.Graphics.PageUnit = GraphicsUnit.Inch Dim dpiX As Single = prtRotatePrinter.Graphics.DpiX Dim dpiY As Single = prtRotatePrinter.Graphics.DpiY For Each pg As DataDynamics.ActiveReports.Document.Page In g_Report180.Document.Pages prtRotatePrinter.StartPage() pg.Units = DataDynamics.ActiveReports.Document.Units.Inches Dim mtxMatrix As New System.Drawing.Drawing2D.Matrix 'Translate to the desired co-ordinates mtxMatrix.Translate(1, 1) mtxMatrix.RotateAt(180, New PointF((pg.Width / dpiX) / 2, (pg.Height / dpiY) / 2)) prtRotatePrinter.Graphics.Transform = mtxMatrix Dim rcPage As RectangleF = RectangleF.Empty rcPage.Width = pg.Width rcPage.Height = pg.Height pg.Draw(prtRotatePrinter.Graphics, rcPage) prtRotatePrinter.EndPage() prtRotatePrinter.Graphics.ResetTransform() Next prtRotatePrinter.EndJob() End Sub |
#5
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |