I have logos of various sizes. I am trying to center them on a label within a ^GB
Is this possible or is there another way of doing this?
Code I tried: ^FO10,295,2^GB585,90^GFA,{items.manufacturer_logo}^FS
The ^GB command is used to draw boxes, not to print graphic fields and the parameters you put after the GB command are the width (585) and height (90) of the box.
Regarding the graphic field (^GF), there isn't a parameter in this field you can use to align to the center the image, so you need to manually enter the coordinates to center the field in the ^FO command, but if you're working on a software which can dinamically calculate the position of the fields, you can maybe do it automatically.
When it comes to design a label in ZPL language, my advice is usually to use zebradesigner, create the label and then export it using the "print to file" option you can find in the print view.
You can download zebradesigner for free from here
https://www.zebra.com/gb/en/support-downloads/printer-software/zebra-designer-3-downloads.html
Related
I'm getting trouble printing some labels with a Zebra GK420t.
I have the next designer and how I need to print:
And the Zebra Designer Essentials generate the next ZPL script:
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR3,3~SD23^JUS^LRN^CI0^XZ
^XA
^MMT
^PW192
^LL0823
^LS0
^FT109,754^A0B,28,28^FH\^FDTEXTHERE^FS
^FT109,482^A0B,28,28^FH\^FDTEXTHERE^FS
^FT109,211^A0B,28,28^FH\^FDTEXTHERE^FS
^PQ1,0,1,Y^XZ
but it only print the center text and it vertically.
What is wrong with my ZPL/design?
It is my first time with this kind of printer, so i'm very newbie and I need use Browser Print, using a Javascript Library, and all ok here. But when I printed it, everything is wrong:
Only print center text
It prints vertically
Text is cut
Thanks
What Mark said is correct, but what I want to add is that I've the feeling you created the label in zebradesigner using the landscape orientation and this explains the B parameter and also why the three text fields are vertically aligned instead of being horizontally aligned.
What you can do instead of trying to manually correct the ZPL code, is to generate a new label using zebradesigner, but setting the orientation to portrait and unselecting the "rotated" option.
Second thing is to configure the label layout in this way, just changing the dimension and the horizontal gap according to the labels you have.
This should generate a valid ZPL code.
Is there a simple way of setting an entire label to print in landscape orientation rather than portrait? I tried the FWR method but it doesn't seem to affect it at all.
I get the feeling i'm going to have to completely realign my fields and graphic boxes if i want to make it landscape.
^FWr command changes orientation of a field.
If you want to set whole label orientation, use ^POa instead, like described e.g. in Label Rotation and Orientation for ZPL based Desktop and Tabletop Printers document.
The ^PO command will only allow you to rotate in 180 degree increments, so that will not help you here.
Unfortunately, the answer to your question is "No." In order to switch between landscape and portrait modes, you will need to manually rotate/reposition/realign all your graphic boxes, text fields, and barcodes. (I feel your pain though, I've had to do this before and it is not fun.)
I want to export certain shapes in powerpoint as images. For that I am using the following code:
ActivePresentation.Slides(1).Shapes(3).Export "C:\dink_template\created_files\testimg.jpg", ppShapeFormatJPG
I also tried with other image formats:
ActivePresentation.Slides(1).Shapes(3).Export "C:\dink_template\created_files\testimg.png", ppShapeFormatPNG
and I get this image:
Here you cannot notice because the white peace that appears in the image button (and also a bit in the top) is mixing with the page but if you make inspect element on the photo you will see it.
As you can see in this other image in powerpoint the shape fix perfectly and it is not bigger that the image:
Why is appearing this white peace in the top and in the button? How can I export the image without them?
EDIT
I know when it is happening. Because I try with other ones and sometimes they where not appearing and sometime it was. The problem is that when the text you write in the shape is so close to the border and you export it as image it export with this white space. Now the question is... how can I solve this?
One option would be to adjust the size of your shape and/or the size of the text accordingly to the total text length, before exporting it as an image, in order to make sure that your text will never be too close to the border...
Something else: have you checked the margins properties of your shape? Putting them to 0 might help a bit.
I'm have some data output text boxes (text boxes with no border and with the same background as the rest of the window) that I'm trying to align with a standard edit control + spin button, to represent a column of numbers, one of which can be edited:
I can manually align these in the Delphi / C++Builder form designer, but when I then view the form on a different version of Windows or at a different DPI, the text is no longer right-justified, presumably because of differences in the spin button spacing, borders, etc.
I can use EM_GETMARGINS to determine the width of the spin button, but how can I determine the size of the edit control's margins and borders? I've tried various combinations of EM_POSFROMCHAR, ClientToScreen, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CXEDGE), and GetThemeMargins, but so far, I can't find a combination that works and makes sense.
More details:
Environment is Delphi / C++Builder XE2.
The data output controls are TEdits with BorderStyle bsNone.
The edit + spin button is a TJvSpinEdit. From viewing its source, it uses EM_SETMARGINS to allow space for its spin button.
Use the Win32 API GetWindowRect() and GetClientRect() methods. The bordering will be the difference between the two rectangles. That will only give you the bordering, though. There could be extra spacing inside the client area.
I have a whole bunch of very narrow columns in a DevExpress GridView and I want to save on column header width by making the caption text (which is too wide even at 3-4 letter abbreviations) slanted / diagonal. Well, so I guess I could get rid of text captions and replace them with pictures of diagonal text, at least if GridView will allow sufficient height for the header.
Is there any built-in way to just display the rotated text without going the image way? I don't think I am the first programmer out there trying to squeeze out horizontal space like that, so this doesn't sound like an outlandish thing to support in a popular grid component :-)
If not, and so I do have to use an image for column header, any relevant suggestions or warnings?
XtraGrid does not provide a built in functionality to show column header captions this way. However, this can be done within the CustomDrawColumnHeader event handler. We have posted a tutorial showing how this can be done. By default, it should be located at:
C:\Users\Public\Documents\DevExpress 2010.2 Demos\Components\WinForms\XtraGrid\CS\GridTutorials\GridVerticalHeaders
NOTE, as this feature is implemented using custom draw. It means that this text is only painted this way. Custom drawn text won't be exported or printed.