FAQ
Here you may find answers on most popular questions regarding PDF Metamorphosis .Net. If you didn't find the answer to your question email us at pdfmetamorphosis@sautinsoft.com.
CSS
- What CSS (Cascading Style Sheets) the component does support now?
- What is the best way to connect CSS into HTML that your component recognize it?
Images
- What type of images does the component support?
Our answers
CSS
- What CSS (Cascading Style Sheets) the component does support now?
Answer: First of all we've made that component supports all common CSS styles. We are improving the component everyday, so this is list is growing too as CSS specification. This is list with styles which are supported by the current version:
| B |
|
|
|
| border: |
border-style: |
border-top-width: |
border-right-color: |
| border-top: |
border-top-style: |
border-right-width: |
border-bottom-color: |
| border-right: |
border-right-style: |
border-bottom-width: |
border-left-color: |
| border-bottom: |
border-bottom-style: |
border-left-width: |
background-color: |
| border-left: |
border-left-style: |
border-top-color: |
border-color: |
| |
|
|
border-width: |
| C |
|
|
|
| color: |
|
|
|
| F |
|
|
|
| font-size: |
font-family: |
font-weight: |
font-style: |
| H |
|
|
|
| height: |
|
|
|
| M |
|
|
|
| margin: |
margin-top: |
margin-right: |
margin-bottom: |
| margin-left: |
|
|
|
| P |
|
|
|
| padding: |
padding-top: |
padding-right: |
padding-bottom: |
| padding-left: |
page-break-before: |
page-break-after: |
|
| T |
|
|
|
| text-align: |
text-indent: |
text-decoration: |
|
| V |
|
|
|
| visibility: |
vertical-align: |
|
|
| W |
|
|
|
| width: |
white-space: |
|
|
| |
|
|
|
| |
|
|
|
| |
|
|
|
- What is the best way to connect CSS into HTML that your component recognize it?
Answer: Actually the component supports all types of connecting CSS to HTML, so you may use any of them:
1. Inline styles, inside the HTML document, style information on a single element, specified using the "style" attribute:
<p style="font-family: Arial; color: red">
2. Embedded style, blocks of CSS information inside the HTML document itself
...
<style>
st1
{
font-family: Arial;
color: red;
}
</style>
...
<p class="st1">
or
<p id="st1">
3. External style sheets, i.e. a separate CSS-file referenced from the document
<link href="css/styles.css" rel="stylesheet" type="text/css">
or
<link href="http://mysite.com/css/styles.css" rel="stylesheet" type="text/css">
Images
- What type of images does the component support?
Answer: It supports JPG, BMP, JPEG, PNG and GIF images. You may specify a full path to image, hyperlink, UNC path or a relative path. These are examples which are supported by the PDF Metamorphosis .Net component:
<img src="file://c:\workingfolder\picture.jpg">
<img src="http://mydomain.com/image1.png">
<img src="www.mydomain.com/image1.png">
<img src="../webs/picture.jpeg">
<img src="//server/webs/picture.jpg">
<img src="sample.gif">
If you are using a relative path image and converting method SautinSoft.PdfMetamorphosis.HtmlToPdfConvertStringToByte or SautinSoft.PdfMetamorphosis.HtmlToPdfConvertStringToFile don't forget to specify the property SautinSoft.PdfMetamorphosis.eHtmlOptions.BaseUrl, for example:
SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();
p.HtmlOptions.BaseUrl = Server.MapPath("");
string html = "<img src=\"sample.gif\">";
p.HtmlToPdfConvertStringToFile(html, @"d:\test.pdf");
|