TCPDF for setting margins - tcpdf

I am generating PDF file using TCPDF, when I try to use inbuilt functions for setting margin, i.e. $pdf->SetMargins(), it doesn't work. My main purpose for it to remove extra space for ul and li tags, because it is disturbing my pdf format and text content mixing into each other.
Any help would be appreciated.

Set margins is for the document itself and it will not affect the ul or lis on the document. You got to set the styling for those yourself. One tip is to do the styling all inline (just pretend that you building up a page for 1990).

Related

How to set a border on a Vaadin component?

I would like to programmatically set a border around a Form component in Java. How can I do this without having to edit the css style sheet?
You could wrap the form with a Panel component, which has a border defined already. Otherwise, not much alternatives than just using CSS.
One option, if you wish to stay inside the server environment, is to use the CSSInject add-on and add the border using that (you still need to write CSS, but you can do it on the server in a Java file and not inside a regular CSS file).
Vaadin Flow — Style::set to specify CSS
In Vaadin Flow (Vaadin versions 10 and later), you can conveniently set CSS for a widget or layout programmatically. No need to edit separate CSS files, even though styling with CSS files is the recommended way.
On your widget/layout, call getStyle to retrieve the Style object.
On that Style object, call set to pass the name and value of your CSS property.
For example, I find setting a bright colored border on my nested layouts quite helpful for debugging.
myVerticalLayout.getStyle().set( "border" , "6px dotted DarkOrange" ) ;
You can see this in action with this screenshot on my Answer to another Vaadin question here:

Wrap text in list items/buttons instead of hiding the overflow

I'm trying to override the default behavior of list items and buttons in jQuery Mobile, which has text which doesn't fit on one line as hidden overflow.
If you view this on a skinny browser window or iPhone you'll see what I mean: http://m.gizmag.com
I'd like to be able to wrap the text in the h3 and p tags of each list item onto new lines.
Thanks in advance!
Try setting a style of white-space:normal for the elements.
I just did this with an anchor (<a>) element inside a jQuery Mobile listview-styled li, and it worked to wrap the text as I expected. I used Chrome's developer tools to determine where the CSS attributes were coming from and interactively changed them to make it work the way I wanted.
--
Derek
If feasible, enclosing it inside a <div> will also make it wrap. (But finding the affected element and declaring white-space:normal is the more proper solution)
Source: http://forum.jquery.com/topic/list-items-are-truncating-text-is-there-a-way-around-this

Sifr 3 a:hover not active outside text

I have an unordered list with links. The links have display:block; in the css so the hover will also have effect in the padding surrounding the links. I replace the list-items with sIFR 3. In the sifr-config.js I specify a hover color for the text but this only works on the text itself, not on the padding surrounding the text. Is there a solution for this problem?
I got it working for the padding on the left side of the text by adding margin-left:'25' in the config for .sIFR-root but margin-right doesn't have the same effect. Help greatly appreciated ;-)
It's hard to say based on your question, but if you replace the individual list items, the entire list item will be a sIFR link. If you want more space around the text you should do this within the Flash movie rather than in CSS. You can use the tuneWidth, tuneHeight, offsetTop and offsetLeft parameters for this.

Prevent sifr on certain titles

I am working on an existing site which uses sifr. It was set up to substitute all h1, h2, etc with sifr. I need to prevent this from happening on just a couple headlines.
Unfortunately because of the timeline I do not have the time to change the sifr-config to be more locked down and then change all of the html pages too.
Is there some way I can add a class to an H1 to prevent sifr?
You can add the sIFR-ignore class to elements you do not want to be replaced.
Please note that any sIFR-related CSS applied to the elements in question (such as .sIFR-active h1 rules) may still apply.

sifr 3 - at my wits' end trying to get the text blocks not to wrap

Looking forward to any help/comments on any aspect of this, but the main question is about sIFR text wrapping, and how to disallow it. This was supposed to be a simple html-izing job (ha ha ha)
Check out here
So I've housed the nav and the content clip boxes in tables, which I know you purists might disdain, but it seemed the easiest/most consistent way... please forgive.
The problem is the sIFR - I can't get one of the nav items ("Exchange Technologies") to behave; it keeps wrapping. Meanwhile, the sIFR headlines in the little content boxes have become unruly and are trying to escape.
I've clogged up the CSS trying to fix it in various elements -- I would be so eternally grateful if a sIFR expert would check it out and see if there are any suggestions on making the sIFR heads work.
Note that I do not need any padding on the bottom of the sIFR elements because the headlines are rendered in all caps.
If it would help I could send along the image of what the designer was looking for.
The forceSingleLine parameter for sIFR.replace() is the easiest way to resolve this. The problem usually arises when the Flash text is wider than the HTML text, and the elements being replaced are exactly the width of the HTML text. In this case the sIFR text won't fit in the allowed space without wrapping.
Another solution is to use letter-spacing through .sIFR-active .myNavItemToBeReplaced CSS rules, to make the HTML text wider so the Flash text does fit without wrapping.

Resources