VS 2010 Printer Co-ordinates In Relation To Margins

May 22, 2012

If I use the following code to draw a rectange, do the values inserted into 'fromleft' & 'fromtop' set a co-ordinate from the top/left corner of the paper or from the top/left corner of the margins.

Dim R As Rectangle
Dim across As Integer = 5
Dim down As Integer = 13

[Code]....

The reason I am asking this question is because I am trying to print labels so the position of the labels on the sheet are fixed. When the printer is set to papersize = letter the first label is in the correct position but when I change it to A4 the first label has moved 4mm to the right. With the margins set to 0 I still cant get it justified correctly. The printer is obviosly capable of printing 4mm from the left because it does so when set to 'letter'. Can't use letter because I need the extra length of A4 for the bottom row of labels.

View 2 Replies


ADVERTISEMENT

Find Hard Margins Of A Printer?

Jun 3, 2011

I searched many pages but unfortunately found nothing. In fact the problem is Printable Area. Microsoft says: The printable area of a page varies from printer to printer and is not guaranteed to be symmetrical.

Does anybody have any code VB which will print a 1cm x 1cm box on a page which is located 1cm from the top and left edages of the paper for any printer?

I think the answer to the question depends on finding hard margins of the printer.

View 1 Replies

Printing With Minimum Margins Specified By The Printer?

Nov 1, 2009

I want to utilize the maximum paper area (A4 size sheet). Therefore I must get the minimum margins that specific printer can handle. I have more printers attached to th pc, so I can not hardcode these values. I have tried to set margins to zero, but that results in printing outside the page at right side and bottom:

PrintDocument1.DefaultPageSettings.Margins.Left = 0
PrintDocument1.DefaultPageSettings.Margins.Top = 0
PrintDocument1.DefaultPageSettings.Margins.Right = 0
PrintDocument1.DefaultPageSettings.Margins.Bottom = 0

So my question is: is it possible to read the selected printers minimum margins without have to open a PageSetupDialog, and therefore make it possible to utilize maximum printing area with code only?

View 1 Replies

Forms :: PointToScreen - Co-ordinates For The Labels In One Statement Without Adding The X And Y Co-ordinates Of The Panels

Nov 2, 2008

Apparently I don't understand what PointToScreen() is actually returning. I'm thinking it should be absolute screen co-ordinates. In a form, I have some labels in a panel, which itself is in a panel and am trying to derive the screen co-ordinates for the labels in one statement without adding the X and Y co-ordinates of the panels. Why does PointToScreen(Label.Location) return the same value as PointToClient(Label.Location) and the same as Label.Location? Shouldn't PointToScreen() return absolute SCREEN co-odinates?

View 12 Replies

VS 2010 Data Relation In ADO.Net?

Aug 12, 2011

I have two tables populated in a dataset using sql data adapter.. i created relation by specifying two columns in each table.. added it in dataset and made datagridview to show related records.. but it shows only first record...

---code

Dim cons As New String("Data Source=xxxxSQLEXPRESS;Initial Catalog=emp;Integrated Security=True")
Dim sql1 As New String("Select * from tab1")
Dim sql2 As New String("Select * from tab2")

use uniscribe in visual basic?

View 4 Replies

VS 2010 : Change The Parent-child Relation In A Treeview Control At Runtime?

May 5, 2012

I want to program a water supply pipeline network in a treeview control. It has five node (junctions). The parent-child relation is based on a parameter (say pressure). Initially, the node 1 is parent and its child nodes are 2 and 3. The node 3 has child nodes 4 and 5. At run time the pressure changes. Now, node 3 is parent and its child nodes are 1, 4 and 5. The node 1 has child node 2.

View 7 Replies

Four Coordinates X,Y ,X' ,Y' - Move Label In These Co Ordinates?

Apr 14, 2010

Is it possible to have forur coordinates in a panel so that i want to move label in these co ordinates.

View 1 Replies

Convert OSGB 36 Co-ordinates To Latitude/Longitude?

Mar 18, 2009

I want to convert British OSGB 36 co-ordinates to WGS 84 (i.e. "standard" latitude and longitude), in order to plot them into a KML file for Google Earth.I should probably add that my question is not "How do I write a KML file?". My question is "How do I convert between these 2 co-ordinate systems?"!!I was hoping there would be a library that I could use, rather than rolling my own function - it seems like the sort of thing some-one else would have implemented.

View 5 Replies

Retrieve All Word Co-ordinates From A Scanned Image?

Mar 11, 2010

Am new to this area, it would great if any one help me on my request. I would like to retrieve each words co-ordiantes (x,y axis) from a jpg file, which is scanned hard copy. I know this can be done with the help of OCR sdk's. But i dont know how to integrate those sdk's with my .net application and retrieve the value. It would be great if some one suggest me the best way or sample codes to do that.

View 5 Replies

Error In Code For Clicking Mouse On Specific Co-ordinates?

Apr 26, 2010

I used the following code to click mouse on the specific co-ordinates on an open windows application

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2

[code].....

View 4 Replies

Print An Array WebBrowser Each Time To A Different Printer Without Changing The Default Printer

Feb 24, 2009

I want to print an array WebBrowser each time to a different printer without changing the default Printer (not to use the SetDefaultPrinter function) I tried to work with the PrintDocument object(he have the Print function and also i can choose a printer name) but I cant attach the

[Code]...

View 1 Replies

Print Word Document In Dot Matrix Printer With Printer Default Font?

Apr 21, 2010

i m using this this coding to copy and print the word document

System.IO.File.Copy(Application.StartupPath &"PrintT.doc", Application.StartupPath & "PrintT1.doc", True)

Dim line1 As String

Dim line2 As String

line1 = "Line1 Replace"

line2 = "Line2 Replace"

[Code]...

now i need to print the Word Document with Printer Default Font(Draft 17.5 CPI) in Dot Matricx Printer

View 2 Replies

Print Directly To The Printer : Change Printer Font Size?

Jul 2, 2010

For my current application development I need direct printing technique,For the purpose I refer Microsoft Support page Titled"How to send raw data to a printer using VB.Net "The code snippnet specified is perfect for my application.Refers link [URL]But I need something more like Setting the Printer font to Condensed.By default my printer use the font 10cpi ,by using this font size I limited to print only 80char on A4 sheet,but I have more than 80 char on line so I prefer Condensed font size.

View 2 Replies

VS 2008 : Get Network Computer's Printer List And Printer Info?

Dec 7, 2009

get a list of printer's (name,port,model) from a computer over the network. I know how to list my own, but it's from querying the Win32_printer object on my machine, I need to be able to do something similar on a remote machine.

View 4 Replies

Check Printer Status On A Win98 Shared Printer?

Sep 3, 2009

I'm trying to check the printer status of a shared printer on a Win98 platform pc and need some samples to get started.

View 3 Replies

Simple Text Printer In 2010?

May 13, 2010

In VB6, when I wanted to print text, I would do something like this...

Dim TextToPrint as string
TextToPrint = LastName(1) & ", " & FirstName(1) & " " & G(1,1) & " " & G(1,2) & " " & G(1,3) & vbCrLf
TextToPrint = LastName(2) & ", " & FirstName(2) & " " & G(2,1) & " " & G(2,2) & " " & G(2,3)
TextToPrint = LastName(3) & ", " & FirstName(3) & " " & G(3,1) & " " & G(3,2) & " " & G(3,3) & vbCrLf
Printer.Print TextToPrint

What's the equivalent in VB 2010?

View 17 Replies

Set The Margins On A Page?

Sep 20, 2011

I am creating a label program and I would like to set the margins of the page for each of the labels. There are 20 labels per 8 1/2" x 11" page at 1 14/16" H x 1 11/16" per label. I would like to know how to set the margins for each label on the sheet. Is there a chart that shows the X and Y coordinates of the page or is there a mathematical equation? Each label would have to be different is there similar code out there that I could get some Ideas?

View 6 Replies

Way To Adjust Margins

Sep 18, 2010

I just moved to VB 2010 Express. PrintForm works, but the image prints with a large left margin and runs off the right edge of the page.[code]...

View 2 Replies

Get Printer DEVMODE Or HDC With Correct Printer Settings

Feb 22, 2011

I have printer vendor provided SDK implementing that i can get printer DEVMODE or HDC with correct printer settings.

My questions is:

I am already using printDocument to print the image (System.Drawing.Bitmap). How can send use this HDC or DEVMOD with printDocument.

I already tried using the "PrintDocument.SetDevMode". it seems not be working.

View 3 Replies

Printer Stuff - Detect If My Printer Is Busy ?

Mar 18, 2011

1. Detect if my printer is busy, because my code tells the printer to print more pages that it can cope with, so I need to delay the command for 'Print the next page' until the printer has finished printing the previous one.

2. Shift the output to my printer so that it gets printed in it's entirety on the paper, instead of seemingly being anchored to some nebulous point on the A4 page. It starts printing at X = 29mm from the left edge, and Y is 28mm from the top, and stops at X = 22mm from the right edge and Y stops at 22mm from the bottom edge, leaving (aprox) 50mm of X and 50mm of Y unprinted.

3. Get useful information on Bounds, which I'm fairly certain is what I need to control where my printing should start and finish.

I've hunted through this forum, MSDN, 'Help' (a misnomer if ever there was one) the VB Library and one or two other forums, which either baffle me with reams of code or suggest code to try which either just don't work or which doesn't declare all the variables and usually don't suggest what type of variable I need, it's all very frustrating

View 9 Replies

Selecting Printer Trays In Word 2010?

Jun 11, 2011

I have an application written in VB.net for batch print jobs. As part of the application, the user selects two printer trays to use to print the batch to (one plain paper the other coloured for coversheets and batch seperators) I had this working until we upgraded our systems from Windows XP with Office 2000 to Windows 7 and Office 2010. Now the selected trays are not being recognised and an error is thrown.

I've looked at similar posts on here and other forums but they seam to concentrate on using some word default trays (wdPrinterDefaultBin etc) however I need to be able to let the user pick whatever tray they wish to use. I don't want to have to go through every printer in the building and map the trays to the word values either as I don't want to rewrite the app everytime we've a new printer.

Here is the code:

sub PopulatePrinterTray (byref Printer as String)
'gets printer trays for selected printer and then populates some comboboxes
Dim pkSource As Printing.PaperSource
Dim printDoc As New Printing.PrintDocument

[code]....

View 1 Replies

VS 2010 Changing Printer Paper Size?

May 16, 2012

I need to set the paper size on a printer to A4. I have tried several different ways to do this but keep getting errors. Currently trying some code I found on the net but I am getting errorsType 'PaperSize' is not defined&PaperKind' is not declaredI am using the following

Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim ps As PaperSize

[code].....

View 2 Replies

VS 2010 Correct Method To Set Printer Pagesize

May 21, 2012

What is the correct method of setting the printer pagesize?The more I google it the more confusedI become as every example seems to be different.

View 1 Replies

VS 2010 PrintForm Not Sending Information To Printer?

Mar 5, 2012

I have been working at printing receipts using printform, but the printer does not seem to be receiving any information from the form. Here is the

Public Sub PrintReceipt()
PrintForm.PrintAction = Printing.PrintAction.PrintToPrinter
PrintForm.Print()
End Sub

When I use the "PrintToPreview" print action, there is nothing shown on the screen.

View 4 Replies

Internal Margins On TextBoxes

Jul 26, 2010

I have some forms that were VS2005 forms the I moved to VS2010. The forms have a tab control and on the tabcontrol are some panel containers. If I add a multi-line textbox toa panel I'm seeing the text offset from the left margin. If I make a form from scratch the margin does not appear.Any idea where this left margin is coming from?Is there a way to set the left internal margin in code?

View 9 Replies

Set Margins In Report Viewer?

Sep 9, 2009

is there solution for to set margin programmatically ? Default margin are 9.8mm, instead i want 3mm?

View 2 Replies

Setting Margins In ReportViewer

Nov 7, 2006

I use Report Viewer to create a report with display records from a database. I have a lot of data to display for each line, but the margin settings are limiting me. If I go to the Page Setup tab in Report viewer(Run time), I can set the margins to 1 (left and right) , and it displays my full line nicely. How can I programatically set the margins to 1 during loading of the form?

[Code]...

View 5 Replies

Select Printer Tray In Visual Basic 2010?

Aug 1, 2011

I want how to select tray means my printer is epson styler 650 CD/DVD Printer. How to Select tray CD/DVD

View 6 Replies

Using .net 2010 PointOfService.POSPrinter Class For Simple Job On POS Printer?

Jan 6, 2012

I need to print a simple receipt to my EPSON-TM-T88V thermal POS printer with VB.NET 2010 on XP (eventually to run on Windows embedded POSReady) via USB.All I need to print is some text and a logo. I have my logo stored on the printer. So, I need to use Epson's ESC/POS commands. So, does it make sense to use Microsoft.PointOfService? Seems like a lot to go through to send some escape sequences to a printer!Apparently, the PointOfService system has not been updated to work seemlessly with VB.net 2010 (details below) That is why I wonder if I am taking the wrong path.IF this is the right path...here is what I did and where I am stuck.

For people trying to us the PointOfService classes in VB 2010:First you need to download and install the POS.net (Microsoft.PointOfService) - free download MS. Then you need to add references in your vb.net project. When you try to run it, you will probably get an error something like this:

{"This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch.

[code]...

View 1 Replies

Entire Workspace Less 10% Margins On Each Side?

Aug 24, 2009

Dim workspace(1 To 4) As Long ' (1)=left (2)=top (3)=right (4)=bottom SystemParametersInfo &H30, 0, workspace(1), 0 ' &h30 = get workspace size Dim X As Long, Y As Long, w As Long, h As Long

X = workspace(1) * Screen.TwipsPerPixelX
Y = workspace(2) * Screen.TwipsPerPixelY
w = workspace(3) * Screen.TwipsPerPixelX - X
h = workspace(4) * Screen.TwipsPerPixelY - Y

Move X + 0.1 * w, Y + 0.1 * h, 0.8 * w, 0.8 * h ' 10% margins

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved