Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Wednesday, November 14, 2012

Which Web Programming language to learn to keep you employed?

There are thousands of programming languages out there and have their own value over one and other. But there are a few programming languages which can keep you employed and you don't have to worry about earnings. Learning a right programming language on right time and right place is very necessary for your carrier. There are many examples out there who are not happy with their field and struggling in the market due to this fact. That's why I am going to share with my blog readers about the best programming languages and their scope in different areas of the world.
  • PHP
  • MySQL
  • Javascript
  • Perl
  • Ruby
  • Python
  • ASP.net

Saturday, September 29, 2012

javascript - window.open not working in IE - (RESOLVED)

Browser compatibility is an issue which each and every web-developer has to face. New window popup using javascript is the same kind of issue and javascript fuction window.open() has different functionality in defferent browsers like in firefox and chrome it works and in IE-8 etc sometimes it does'nt work.

I also faced this problem today and did R&D on it, and found a very simple solution to this. here is the solution of this problem.

In IE, you can't have spaces in your second variable (the new window's name).

Try:
 
window.open (address,'Ver_articulo', config=center);
 
Please post your comment and share this with others if you really like this post. 

Friday, May 18, 2012

How to change "font-family" in dompdf script

In latest web development industry document conversion from one format to other format is very important. Sometimes we need to generate spread sheet files, some times we need to generate word files and some times PDF files. In this topic I will be talking about PDF file conversion.

For generating PDF files from the given data, there are a number of scripts and modules written in php and different languages. DomPDF is one of them written in php. DomPDF is fabulous in its features. It allows direct conversion of HTML files to PDF files. But there are some limitations like some times it never generates the exact copy of that HTML. Some times font-family doesn't apply correctly as we apply in HTML file. I had the same problem last days when I was using DomPDF for my PDF generation. I goggled the web and found some solutions. And on the basis of those many solutions and posts, I wrote a summarized article focusing on this problem.

It need some simple steps to follow,

  1. Download archive from approved answer. Extract files /dompdf/lib/fonts/times*.*.
  2. Copy them in your dompdf fonts folder.
  3. Edit dompdf_font_family_cache.dist.php with snippet 1.
  4. In CSS use font-family: times;.

Snippet 1:

 /* ... */  
 'times' => array (  
   'normal' => DOMPDF_FONT_DIR . 'times',  
   'bold' => DOMPDF_FONT_DIR . 'timesbd',  
   'italic' => DOMPDF_FONT_DIR . 'timesi',  
   'bold_italic' => DOMPDF_FONT_DIR . 'timesbi'  
 ),  
 'times-roman' => array (  
   'normal' => DOMPDF_FONT_DIR . 'times',  
   'bold' => DOMPDF_FONT_DIR . 'timesbd',  
   'italic' => DOMPDF_FONT_DIR . 'timesi',  
   'bold_italic' => DOMPDF_FONT_DIR . 'timesbi'  
 ),  
 /* ... */  

If you want to use your own TTF font (say, Arial.ttf):
  1. Run: ttf2afm -o Arial.afm Arial.ttf. (I did it in Ubuntu.)
  2. Run: ttf2ufm -a -F Arial.ttf. (you can use /dompdf/lib/ttf2ufm/bin/ttf2ufm.exe.)
  3. Copy Arial.* files in /dompdf/lib/fonts/.
  4. Add to dompdf_font_family_cache.dist.php snippet 2.
  5. In CSS use font-family: arial;.

Snippet 2:

 /* ... */  
 'arial' => array (  
   'normal' => DOMPDF_FONT_DIR . 'Arial',  
   'bold' => DOMPDF_FONT_DIR . 'Arial',  
   'italic' => DOMPDF_FONT_DIR . 'Arial',  
   'bold_italic' => DOMPDF_FONT_DIR . 'Arial'  
 )  
 /* ... */  

 Please feel free to post you comments and suggestions.

Thanks