How to resize attribute boxes in Visio attributes - visio

This is a very simply request, but I cannot locate the solution. I have Visio 2016 and the layout within Visio is using the Crows foot database notation, with Entities and Attributes within. However, it appears I cannot change the thickness of a text box and therefore the result is a very long Entity:
There are no leading or trailing blanks, nor is the text very large or and the container is not locked.
How can I change the shape of these attribute boxes?

Related

Drawing graphical objects (boxes and lines) inside a structured iText(Sharp) document (Chapters and Sections)

I'm creating a PDF document using iTextSharp, what I'm doing is generating all of my content in a c# List<Chapter> where the Chapters contain one or more Sections, and the Chapters have not yet been added to the document. I then enumerate through my List<Chapter> to generate a table of contents at the start of the document, and then add the Chapters to the document after my TOC.
That works great when my Sections contain text and images, but now I need to generate a Section containing boxes and lines. I don't want to draw my boxes and lines into an image and drop the image into the Section, that won't look as good as if I have actual PDF boxes and lines.
The Sections containing graphical elements can be intermixed with Sections containing text, so I need a way to add some kind of element to a Section such that that graphical Section works like text Sections in terms of going onto a new page only if necessary.
What's the best way to do this? I feel like it somehow involves PdfTemplates but I'm not sure how. Or maybe I need to create a PdfPTable and create my graphical elements in an IPdfPCellEvent?
You are on the right track when you want to involve PdfTemplate elements. PdfTemplate is an iText object that corresponds with the concept of Form XObjects in the PDF specification. We chose another name because the word Form is somewhat misleading (people confuse it with form fields, interactive forms, etc).
The content stream of a page in PDF is a sequence of PDF syntax, consisting of operands and operators. An XObject is an object that is external to this content stream. The content of an XObject is stored inside the PDF document only once, but it can be reused many times on the same page, on different pages.
There are different types of XObjects, but Image XObjects and Form XObjects are the most important ones.
Image XObjects are used when we work with raster images. You are absolutely right when you write: *"I don't want to draw my boxes and lines into an image and drop the image into the Section, that won't look as good as if I have actual PDF boxes and lines."
Form XObjects are used when we want to reuse PDF syntax. This is what you need: you want to define moveTo(), lineTo(), curveTo(), stroke(), fill(),... operations, and you want these lines and shapes to be stored as vector data.
The solution to your problem is to draw lines and shapes to a PdfTemplate object and to wrap the PdfTemplate object inside an Image object. When you add that Image object to a Section or a Chapter, it will be added as a Form XObject. You don't have to feat that it will be degraded into a raster image.
You can find some examples of this technique on the official web site. For instance in the answer to the question
How to generate 2D barcode as vector image?
Here we create a PdfTemplate with a bar code and we return it as an Image object. The screen shot that shows you the internals of the resulting PDF proves that the bar code is added as a vector image.
public Image createBarcode(PdfContentByte cb, String text,
float mh, float mw) throws BadElementException {
BarcodePDF417 pf = new BarcodePDF417();
pf.setText("BarcodePDF417 barcode");
Rectangle size = pf.getBarcodeSize();
PdfTemplate template = cb.createTemplate(
mw * size.getWidth(), mh * size.getHeight());
pf.placeBarcode(template, BaseColor.BLACK, mh, mw);
return Image.getInstance(template);
}
To create a PdfTemplate object, you need a PdfContentByte instance (e.g. using writer.getDirectContent()) and use the createTemplate() method passing a width and a height as parameters. Then you draw content to the PdfTemplate and turn it into an Image object using Image.getInstance().
You'll find more info on drawing lines and shapes in the chapter on Absolute positioning of lines and shapes and in the example section of Chapter 3 and Chapter 14 of my book.

Borders doubling up on Jasper report

I may be approaching this the wrong way but I've created a few Jasper reports now (Eclipse plugin) which I am exporting variously to pdf, docx and odt. The only way I've found to create 'tables' is to position adjacent text boxes. I've noticed that I get lines of double thickness if I leave borders overlapping (i.e upper box has a solid bottom border and lower box has a solid upper border), even if I position them on top of each other.
So far no problem as I have been configuring the borders to not overlap (i.e. where 2 text boxes overlap I leave one of the borders as transparent). However one of my sub reports is just a repeating box in the detail section though so I can't do this here or the bottom or top would be missing. I'm assuming this must come up a lot ? Is there a way around this ?
I must admit I haven't tried setting the bottom border blank yet and adding a line at the bottom of the 'table' as I'm hoping there may be a more appropriate technique ?
Apologies if this isn't clear. Please let me know if not.
Thanks,

Word Styles to get two elements to share same background/border

Within MS Word 2013 I am trying to create a text element plus a list underneath it, all wrapped inside a coloured border with background shading (see image). The attached image shows the text in plain form.
I would like to place a blue border around both the title and the list. I can achieve this by placing both objects within a 1x1 table and applying colouring rules to the cell, but semantically this seems bad (I'm from an HTML development background where it is very wrong!)
When I edit a Style rule to create the border/background, it works well until I create the list, then it goes badly wrong. Is it possible to achieve the output of the table cell approach by only using a style rule and no table?
After a day of experimentation, the closest I can get is by doing the following:
Create a style rule called Tips Heading based on Normal, then set it to be Bold with a blue background.
Create another style rule called Tips List based on List Paragraph, and set it to have a blue background.
Unfortunately the List cannot be indented because the background colour also indents. The border is also affected in this manner, so I ignored the border and indentation. It works really well and is semantically well structured.

Visio 2013: How to reduce width of built-in UML class shape?

I drew a class diagram of the type 'UML static structure' with Visio 2013. Now I would like to reduce the width of the class shapes in the diagram. I removed the size protection in the developer tools section and also tried to set the width in the corresponding shape sheet but nothing worked.
Does someone know how to do this?
In Visio 2013, you can change class width using a control point (yellow dot), just drag it:
The class shape is composed of a group of objects. You should drag your mouse over it to select not only the external shape, but also all the elements inside it such as the ClassName text and any possibly existing members, etc.
Now, if you remove the size protection as you mentioned, this will apply to all the elements, and then you can change the size using "Size & Position" task pane. (Ribbon --> View --> Show --> Task Panes)

CCLabelBMFont has empty space on the top and bottom...how to remove?

When I generate a CCLabelBMFont object, the font seems to include some leading whitespace on the top and bottom of the characters, and this empty space is included in the font object that I create. Sometimes, I need to position the object precisely by the top and bottom, and this offset ruins my spacing. I want to do is trim the font so that its bounds and content size is only the space in which there are no pixels with an alpha greater than 0.
Using Glyph Designer you can export FNT/PNG files. Although the parameter is not exposed in GlyphDesigner GUI, you can modify (decrease) the lineHeight parameter directly in the FNT file. You can also change the yOffset parameter for every character included in your font.
It makes it a little harder to maintain as those manual changes will be overwritten each time you re-publish with GlyphDesigner, but at least you have a way to adress your problem.
Hope that helps.
You can use a tool like Glyph Designer to set the padding and spacing parameters for your BMFont.
Glyph Designer: http://glyphdesigner.71squared.com