Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

HTML to PDF. Layout ('top' CSS tag) on text in divs are not working.

$
0
0
Hi,

I am having a problems with a block of code and I can't figure out how to resolve it.

What I wanted was the <div> to have a background image and then I could place text within the div. I don't think Aspose PDF has this functionality (which would be useful).

I therefore tried a different method (see below):

HTML:

<div class="imagebk">
<img src="mypic.png">
<p class="titleheading">Outline</p>
</div>

CSS:

div.imagebk 
   position: relative;
   width: 1115px;
   height: 788px;
   margin-left: 0px;
   margin-top: 0px;
   margin-bottom: 0px;
   margin-right: 0px;
   text-align:left;
}

p.titleheading 
   position: absolute;
   top: 20px; 
   left: 60px;
   width: 1115px; 
   font-family: Calibri; 
   font-size: 90pt;
   color: #ffffff;
}

The above sort of works but the PDF generator is not registering the CSS 'top' tag.
The CSS 'left' tag seems to be working fine, but I have tried and tried and tried again but I can't get it working.

I have attached a picture to illustrate my point. This is what is generated on the output. As you can see it has moved left but not moved down.

It is really annoying and I need some urgent help in fixing it.

Kind Regards,
Will

Viewing all articles
Browse latest Browse all 3131

Trending Articles