?
Solved

None printing area on Inkjet-/laser printers

Posted on 1998-09-24
4
Medium Priority
?
269 Views
Last Modified: 2010-04-30
How do I get the top,bottom,left and right margin where a laser/inkjet printer cannot print. As far as I know, can I only get physical forms length/width and the printing forms length/width. Do anybody know if there is any way to get the exact margins where the printer cannot print.
I shall use these exact mesaures, because im making a form with an OCR-B line which an optical reader shall read, and the tolerance is a very small. I don't how and where to get these informations?
0
Comment
Question by:ertro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:dabellei
ID: 1436410
The only way is to contact the manufacturer of the printer or reading the books that comes with the printer were this should be mentionned clearly.
0
 

Author Comment

by:ertro
ID: 1436411
Their must be another answer, I can read printer manual too, but I don't know which printer users of my program have, it vill be distibuted over the internet. I have made an solution today, where I make a box for the printing area, then the user can measure the none printing margins. If I have the top-,left margin or Bottom,right margin I can calculate the opposite. It may be the only way, but it isn't very elegant.
0
 
LVL 2

Accepted Solution

by:
schild earned 200 total points
ID: 1436412
Hello ertro

Try the folowing code:


   Private Const PHYSICALOFFSETY As Long = 113

   Private Declare Function GetDeviceCaps Lib "gdi32" ( _
      ByVal hdc As Long, ByVal nIndex As Long) As Long
   Private Declare Function SendMessage Lib "USER32" Alias "SendMessageA" _
      (ByVal hWnd As Long, ByVal msg As Long, ByVal wp As Long, _
      lp As Any) As Long

Public Sub MyPrinterCaps()

      ' Start a print job to get a valid Printer.hDC
      Printer.Print Space(1)
      Printer.ScaleMode = vbTwips

      ' Get the offsett to the printable area on the page in twips
      LeftOffset = Printer.ScaleX(GetDeviceCaps(Printer.hdc, _
         PHYSICALOFFSETX), vbPixels, vbTwips)
      TopOffset = Printer.ScaleY(GetDeviceCaps(Printer.hdc, _
         PHYSICALOFFSETY), vbPixels, vbTwips)


End Sub
0
 

Expert Comment

by:rukiman
ID: 2560398
With that code, can you tell the X and Y offsets for any printer accurately for any printer? I tested the code, it worked fine for the Y offset, but the X offset was way off, how come?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question