Im' using the win api and some funcions from winspool.h to work with my printers. Functions like OpenPrinter/StartDoc/ etc...
I'm able to print and everything looks fine. The only problem, or issue i can't addrress is about margins.
My printer seems to add some weird bottom margin and some images/text that are close to bottom are cutted off.
I want to remove this margin, and from other programs i can use the print setup to remove them.
but i can't find out how to do it from my code. Something like:
dc->margin = ▭
or:
dc->margin->bottom_margin = 0;
Any ideas?
You can get printer margins. Look for PHYSICALOFFSETX and PHYSICALOFFSETY.
Usually people get it and after they do minus from margins what they need.
But window program for printing pictures can print without any margins.
I couldn't find information how it does it. I think it's undocumented feature.
Related
Consider the below ZPL code.
^XA
^BY2,2,80
^FO50,50^BCR^FD3079+Plate-SS-14 # 44^FS
^XZ
Using the online viewer at http://labelary.com/viewer.html shows you vertically rotated bar code with label beneath and everything appears to be fine.
However, when I print the label the bar code is not scan-able because the lines of the bar code are too thick (see below images). Removing the rotate flag from ^BCR and making it ^BC fixes the issue and the lines are perfectly normal and scan-able. I have tried numerous different methods to rotate the code with no success and can't wrap my head around as to why the lines become thicker when rotating a bar code.
Does anyone have any insight as to why this happens?
Broken Rotated Barcode Image
Working (not rotated) Barcode Image
In my case, the solution was the printing speed being too fast. Another potential solution would be to turn down the darkness or temperature of the printer itself if it's an option in the settings.
Simply opening my respective zebra printer's printing preferences showed me a Print Speed setting which was set to 12.7 cm/s. Reducing it down to 10.1 cm/s fixed the problem.
Adjust the Darkness of the printing and/or the speed of the printing. that should solve your problem.
I think it is a problem with your use of the PNG file that the site generates. The PNG file generated includes enough whitespace in the front (top) quiet zone of the symbol to scan, but if you use the Windows system viewer to print the barcode and print in full size, it slices off the top-most bars.
Try embedding the PNG file into a document, setting the photo size to less than full page, or use the PDF file.
In this screenshot of my vimrc settings, I have installed the plugin vim-airline using vundle. After going through airlines docs, I found the set of lines to customise my airline.
The problem is the ones highlighted in red. The blue highlighted one works fine but the red one does not. The left one is same as right one. I tried using different Unicode symbols but does not work. Any workaround to this situation as this is troubling my OCD :P.
Thanks in advance.
This is a well-known issue related to the font (size and family) used in your terminal.
For a better display, you have two solutions:
Do not use arrows as separators
Configure your terminal emulator to use a patched font with the right size
If you prefer the first solution, make sure you have this code in your .vimrc:
let g:airline_right_sep = ""
let g:airline_left_sep = ""
If you prefer the other solution, take a look at this: https://github.com/powerline/fonts
I have used the Hack font with size 11 for a long time and the arrows are perfectly displayed in my editor...
i have spent q good bit of time getting a zebra printer to work with os x for barcode printing from a browser.
the difficulty i am now having is with safari properly displaying the margins/padding. even though i have all margins etc. set to 0 with CSS with #page and body, html. it still prints with about 1/4" margin. does anyone know a way to remove this? it works fine in chrome and firefox scales it so small it's unreadable when using 4x1" paper settings.
as an aside, is it possible to for Safari (or any app) to remember the paper size from the last print job? even when i save the print profile, it always defaults to Default paper size.
thanks.
It looks like safari automatically adds the 1/4" border as not all printers are capable of edge-to-edge output. For optimum output quality and overall control you need to write native ZPL code and spool to the device.
Greetings everyone,
A friend and I are discussing the possibility of a new project: A translation program that will pop up a translation whenever you hover over any word in any control, even static, non-editable ones. I know there are many browser plugins to do this sort of thing on webpages; we're thinking about how we would do it system-wide (on Windows).
Of course, the key difficulty is figuring out the word the user is hovering over. I'm aware of MSAA and Automation, but as far as I can tell, those things only allow you to get the entire contents of a control, not the specific word the mouse is over.
I stumbled upon this (proprietary) application that does pretty much exactly what we want to do: http://www.gettranslateit.com/
Somehow they are able to get the exact word the user is hovering over in almost any application (It seems to have trouble in a few apps, notably Windows Explorer). It even grabs text out of obviously custom-drawn controls, somehow. At first I thought it must be using OCR. But even when I shrink the font so far down that the text becomes a completely unreadable blob, it can still recognize words perfectly. (And yet, it doesn't recognize anything if I change the font to Wingdings. But maybe that's by design?)
Any ideas as to how it's achieving this seemingly impossible task?
EDIT: It doesn't work with Wingdings, but it does work with some other nonsense fonts, so I've confirmed it can't be OCR.
You could capture the GDI calls that output text to the display, and then figure out which word's bounding box the cursor falls in.
Well, for GDI controls you can get the position and size of the control, and you can usually get the font info. For example, with static text controls you'd use WM_GETFONT. Then once you have that you can get the position of the mouse relative to the position of the control and use one of the font functions, perhaps something like GetTextExtentPoint32 to figure out what is under the cursor. I'm pretty sure the answer lies in that direction...
You can run dumpbin /imports on the other application and see what APIs they are calling.
I would like to write a script that moves the currently open Windows to a certain location.
Ideally, my program would look like this:
var window = FindWindow("Winamp");
window.setPos(1140, 900, 160, 124); // set x, y, width and height
window = FindWindow("Windows Live Messenger");
window.setPos(1140, 0, 900, 124);
// etc...
I suspect that I need to use the Windows Scripting Host. I had a look at the documentation on MSDN, but I can't seem to find the API calls that I need.
Can someone point me in the right direction?
PS: It doesn't have to be a scripting language, C++ is fine as well.
I think you're looking for SetWindowPos. Here's a CodeProject article that supposedly (I haven't looked carefully at the code) shows how to use it from vbscript: Moving a borderless window - an alternate way
Also, an alternative to FindWindows would be EnumWindows, which can be useful if you don't have the exact information needed to use FindWindows and would instead want to get a list of all windows and your code could then select the most suitable window.
If you're looking for something easy to code, you can use AutoIt, available here: http://www.autoitscript.com/autoit3/index.shtml. I have personaly not used it, but it seems to be able to achieve what you want, and more.
You might also want to look into AutoHotKey. I have only used it for some very basic things myself. But I know it has pretty sophisticated scripting abilities.