Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

None printing area on Inkjet-/laser printers

Posted on 1998-09-24
4
Medium Priority
?
270 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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

618 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