Probleblem with Hebrew Mail Subject - c#

I have next problem:
string Domain = string.Empty;
string Selector = string.Empty;
IPrivateKeySigner privateKey = null;
Domain = "MyDomain.co.il";
Selector = "MyDomaincoil";
privateKey = PrivateKeySigner.Create(PK_Coil); //PK_Coil - var with another Dkim
var msg = new DKIM.MailMessage();
msg.To.Add("check-auth#verifier.port25.com"); // for check
msg.From = new MailAddress("daabaev#gmail.com", "Email head", System.Text.Encoding.UTF8);
msg.Subject = "Jumbomail - קיבלת מייל חדש‎"; // hebrew title
msg.Body = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\r\n <title></title>\r\n</head>\r\n<body style=\"margin: 0px 0px 0px 0px; margin-right: auto; margin-left: auto; font-family: arial, Calibri, 'lucida grande';\r\n font-style: italic; font-size: 16px;\">\r\n <div style=\"font-size:14px;margin-left:auto;margin-right:auto;width:680px;text-align:center\">\r\n\t\t#LANG#<br />\r\n\t</div>\r\n\t<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 680px;\" align=\"center\">\r\n <tr>\r\n <td style=\"width: 680px;\">\r\n <!--// Start Header -->\r\n <div>\r\n </div>\r\n <div style=\"width: 680px; text-align: center;\">\r\n <img src=\"http://localhost:6169/GeneralHandlers/LoadUserMailImage.ashx?type=header&image=header_270053_8_2014_16_45_21.jpg&pathId=2\" alt=\"\"\r\n title=\"\" style=\"border: 0px; width: 680px;\" />\r\n </div>\r\n <div>\r\n </div>\r\n <!--// End Header -->\r\n <!--// Start Body -->\r\n\t\t\t\t<div style=\"WIDTH: 680px; FONT-FAMILY: Arial\"> <table style=\"WIDTH: 680px; FONT-FAMILY: arial; FONT-SIZE: 14px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td style=\"WIDTH: 15px\"></td> <td style=\"WIDTH: 650px\"> <div style=\"DIRECTION: rtl\" dir=\"rtl\"> <table style=\"WIDTH: 680px; FONT-FAMILY: arial; FONT-SIZE: 14px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr> <td align=\"center\" style=\"width: 400px\"> <div style=\"TEXT-ALIGN: center; direction: rtl\"> <span style=\"FONT-SIZE: 18px; FONT-WEIGHT: bold\">שלום</span>, <br> <span style=\"FONT-WEIGHT: bold\">or#netbiz.co.il</span> <span style=\"direction:rtl\"> שלח/ה אלייך מייל באמצעות Jumbomail. </span><br> <div style=\"TEXT-ALIGN: right; DIRECTION: rtl\"> <br> <div style=\"TEXT-ALIGN: right; DIRECTION: rtl\"> <br> <span style=\"FONT-WEIGHT: bold\"></span> <br> <br> </div> </div> <br> </div> </td> <td style=\"width: 20px; BORDER-RIGHT: #cccccc 1px solid; FONT-SIZE: 1px; width: 1px; height: 200px;\"> </td> <td align=\"center\" style=\"width: 280px\"> <img title=\"לחצו כאן להורדת הקבצים\" border=\"0\" alt=\"לחצו כאן להורדת הקבצים\" src=\"http://localhost:6169/App_Themes/MailTemplate/he-IL/downloadbtn.jpg\" /> <br> להורדת הקבצים לחצו כאן<br> <br> <span style=\"COLOR: #797979\"> <span dir=\"rtl\" style=\"FONT-WEIGHT: bold\">לתשומת ליבך:</span> מייל זה יהיה נגיש להורדה עד לתאריך 25/12/2014. </span><br> </td> </tr> </table> <div> </div> <br> <div> <div align=\"right\"><img alt=\"\" title=\"\" style=\"border: 0px;\" src=\"http://localhost:6169/GeneralHandlers/LoadUserMailImage.ashx?type=logo&image=logo_270053_8_2014_16_45_38.jpg&pathId=1\" /></div> <br> </div> <div> <br> </div> </div> </td> <td style=\"WIDTH: 15px\"></td> </tr> </tbody> </table> </div>\r\n <!--// End Body -->\r\n <!--// Start Footer -->\r\n <div style=\"border-top: 1px solid #e1e4e7;\">\r\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"680px\" style=\"direction: ltr;\">\r\n <tr>\r\n <td style=\"text-align: left; padding: 0px; margin: 0px; border: 0px; height: 42px;\r\n width: 11px;\">\r\n <img src=\"http://localhost:6169/App_Themes/MailTemplate/mail-user-footer-left.jpg\"\r\n style=\"width: 11px; height: 42px; border: 0px; float: left;\" alt=\"\" />\r\n </td>\r\n <td style=\"background: #b5bbc2; font-size: 1px; height: 42px; width: 670px; padding: 0px;\r\n margin: 0px;\">\r\n\t\t\t\t\t\t\t\t \r\n </td>\r\n <td style=\"text-align: right; height: 42px; padding: 0px;\r\n margin: 0px; border: 0px; width: 11px;\">\r\n <img src=\"http://localhost:6169/App_Themes/MailTemplate/mail-user-footer-right.jpg\"\r\n style=\"width: 11px; height: 42px; border: 0px; float: right;\" alt=\"\" />\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <!--// End Footer -->\r\n </td>\r\n </tr>\r\n </table>\r\n</body>\r\n</html>";
msg.Sender = new MailAddress("company email.co.il");
msg.IsBodyHtml = true;
DkimSigner dkim = new DkimSigner(privateKey, Domain, Selector, new string[] { "From", "To", "Subject" });
msg.DkimSign(dkim);
System.Net.Mail.SmtpClient c = new System.Net.Mail.SmtpClient();
c.Port = 25;
c.Host = "my host";
c.Send(msg);
So if i try send message with English title - I am not have problem - i got mail; WITH Signed by:
But if i switch to Hebrew title (I change ONLY title) - I got mail WITHOUT Signed by:
Guys what i need to do?? Thank you.
(Sorry for my english)

Related

Gembox document HTML to PDF losing details

I just dowloaded the newset version of gembox document in order to convert ah html file into PDF.
It seems to be working, but the resulting PDF is losing some information.
Here is what the HTML looks like:
<html>
<head>
<style>
.main-container {
width: 383.62px;
height: 576.95px;
text-align: center;
padding: 96px 48px;
font-family: Verdana;
}
.code {
font-size: 25px;
font-weight: bold;
letter-spacing: 1px;
}
.mrg-btm {
margin-bottom: 8px;
}
.name-and-code {
font-size: 24px;
font-weight: bold;
letter-spacing: 3px;
}
.flex-div {
display: flex;
flex-direction: row;
width: 100%;
}
.distance-one {
width: 50%;
text-align: left;
font-size: 14px;
}
.distance-two {
width: 50%;
text-align: right;
font-size: 14px;
}
.font-bold {
font-weight: bold;
}
.scadenza {
font-size: 24px;
font-weight: bold;
letter-spacing: 3px;
}
.data-scadenza {
font-size: 24px;
font-weight: bold;
letter-spacing: 2px;
}
.materiali {
font-size: 24px;
font-weight: bold;
text-align: left;
letter-spacing: 5px;
}
.last-codes {
display: flex;
flex-direction: row;
font-size: 14px;
text-align: left;
font-family: TimesNewRoman;
}
.mrg-btm-two {
margin-bottom: 64px;
}
.mrg-btm-three {
margin-bottom: 16px;
}
.mrg-btm-four {
margin-bottom: 20px;
}
.mrg-rgt-one {
margin-right: 20px;
}
.mrg-rgt-two {
margin-right: 8px;
}
.mrg-rgt-three {
margin-right: 16px;
}
</style>
</head>
<body>
<div class="main-container">
<div class="code mrg-btm">
<label>STM0583A0</label>
</div>
<div class="name-and-code mrg-btm-four">
<label>TUNISI 0583</label>
</div>
<div class="mrg-btm-four">
<img alt='Barcode Generator TEC-IT'
src='https://barcode.tec-it.com/barcode.ashx?data=02329747&code=Code39'/>
</div>
<div class="flex-div mrg-btm">
<label class="distance-one">SqA</label>
<label class="distance-two font-bold">2481m (#13)</label>
</div>
<div class="flex-div mrg-btm-three">
<label class="distance-one">GOMSET1 (#2)</label>
<label class="distance-two">11/10/2022</label>
</div>
<div class="scadenza mrg-btm">
<label>Scadenza</label>
</div>
<div class="data-scadenza mrg-btm">
<label>31/10/2022</label>
</div>
<div class="materiali mrg-btm">
<label>Materiali</label>
</div>
<div class="last-codes mrg-btm-two">
<label class="mrg-rgt-one">RC1812</label>
<label>000331799805</label>
</div>
<div class="last-codes mrg-btm">
<label class="mrg-rgt-two">SB00040A0</label>
<label class="mrg-rgt-two">STR1026420</label>
<label>25/10/2022</label>
</div>
<div class="last-codes">
<label class="mrg-rgt-two">C-1812</label>
<label class="mrg-rgt-three">RC1812</label>
<label>000331799805</label>
</div>
</div>
</body>
</html>
Here is the c# code. I tried several methods but none of them work.
GemBox.Document.ComponentInfo.SetLicense("FREE-LIMITED-KEY");
DocumentModel document = DocumentModel.Load(filenameHtml);
document.Save(path + pdfFilename);
//CODE 2
GemBox.Document.ComponentInfo.SetLicense("FREE-LIMITED-KEY");
string body = File.ReadAllText(filenameHtml);
var htmlLoadOptions = new HtmlLoadOptions();
using (var htmlStream = new MemoryStream(htmlLoadOptions.Encoding.GetBytes(body)))
{
var document = DocumentModel.Load(htmlStream, htmlLoadOptions);
document.Save(path + pdfFilename);
}
I tried also setting up some parameters, but in every test, the size of the area of the HTML was lost, the Times New Roman font as well, and also the flex div spacing some elements.
Here is what the original xml looks like:
And here is the result
What can I change to make the Gembox Document output look like the original?

Selectpdf - cannot remove top margin on page

I am using SelectPdf, and when configuring my converter to convert the string to a pdf, my pdf keeps ending up generating some margin on the top of the page.
My converter:
private Stream ConvertToPdf(string data)
{
HtmlToPdf converter = new HtmlToPdf();
converter.Options.PdfPageSize = PdfPageSize.A4;
converter.Options.AutoFitWidth = HtmlToPdfPageFitMode.NoAdjustment;
converter.Options.DisplayFooter = true;
converter.Options.DisplayHeader = true;
converter.Options.MarginTop = 0;
converter.Options.MarginBottom = 0;
converter.Options.DisplayHeader = false;
converter.Options.DisplayFooter = false;
converter.Options.CssMediaType = HtmlToPdfCssMediaType.Screen;
converter.Options.EmbedFonts = true;
PdfDocument doc = converter.ConvertHtmlString(data);
// create memory stream to save PDF
MemoryStream pdfStream = new MemoryStream();
// save pdf document into a MemoryStream
doc.Save(pdfStream);
pdfStream.Seek(0, SeekOrigin.Begin);
return pdfStream;
}
In my template, I have no apparent margin in the top of the page, so I am, so far, unable to figure out where it is coming from.
My template:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html, body {
font-family: Arial, Helvetica, sans-serif;
margin:0;
padding:0;
}
.red-color {
color: red;
margin-left: 10px;
}
p.red-color {
margin-top: 0;
font-weight:800;
}
p.red-color:first-of-type {
margin-bottom: 0;
}
h1.red-color {
margin-bottom: 10px;
margin-top:0;
}
h2.red-color {
margin-bottom: 20px;
}
#wrapper {
position: relative;
width:750px;
height:1050px;
}
.image-wrapper {
width: 96%;
height: 350px;
margin-left: 2%;
position: relative;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
#info-banner {
position: absolute;
bottom: 0;
background-color: red;
width: 96%;
margin-left: 2%;
height: 125px;
}
#info-banner #banner-left {
float:left;
width:40%;
}
#info-banner #banner-right {
float:left;
width:60%;
}
#info-banner #banner-left a {
display: block;
text-align: center;
margin-top: 20px;
color: white;
text-decoration: none;
}
#info-banner #banner-left a img{
width:50px;
}
#info-banner #banner-right p:first-of-type {
margin-top:20px;
}
#info-banner #banner-right p {
margin: 0;
color: white;
padding-bottom: 5px;
font-size: 14px;
}
.amount {
text-align:left;
padding-left:5px;
}
.name {
}
.price {
}
table th {
text-align: left;
}
td {
padding: 10px 0;
}
table {
width: 96%;
margin-left:2%;
border-collapse: collapse;
}
.top-border {
border-top: 2px solid black;
}
.heavy-font {
font-weight: 800;
}
.less-spacing td{
padding:5px 0;
}
</style>
</head>
<body>
<div id="wrapper" style="page-break-after: always">
<h1 class="red-color">Name</h1>
<div class="image-wrapper" style="background-image: url('##EventImage##');"></div>
<h2 class="red-color">##Title##</h2>
<p class="red-color">your ticket:</p>
<p class="red-color">Print it.</p>
<table>
<tr>
<th>Amount</th>
<th>name</th>
<th>Price</th>
</tr>
<tr class="top-border">
<td class="amount">##Amount##</td>
<td class="name">
##Title##<br />
Adresse: ##Address## <br />
Dato: ##Date##<br />
Tidspunkt: ##Time##
</td>
<td class="price">##Price## USD</td>
</tr>
<tr class="top-border ">
<td class="amount"></td>
<td class="name">In Total</td>
<td class="price">##ProductTotalPrice## USD</td>
</tr>
<tr class="less-spacing">
<td class="amount"></td>
<td class="name">Total ex. tax:</td>
<td class="price">##ProductTotalExTax## USD</td>
</tr>
<tr class="less-spacing">
<td class="amount"></td>
<td class="name">shipping: </td>
<td class="price">##ShippingPrice## USD</td>
</tr>
<tr class="less-spacing">
<td class="amount"></td>
<td class="name">Subtotal ex. tax</td>
<td class="price">##PriceNoTax## USD</td>
</tr>
<tr class="less-spacing">
<td class="amount"></td>
<td class="name">tax</td>
<td class="price">##Tax## USD</td>
</tr>
<tr class="top-border">
<td class="amount"></td>
<td class="heavy-font name">Total:</td>
<td class="heavy-font price">##FinalPrice## USD</td>
</tr>
</table>
<div id="info-banner">
<div id="banner-left">
<img src="facebook-icon.png" /><br />Find us on facebook
</div>
<div id="banner-right">
<p>Name</p>
<p>Address</p>
<p>Second Address</p>
<p>Phone: 0000000000 Email: info#test.com</p>
</div>
</div>
</div>
</body>
</html>
When I generate this, I have no issues making it a pdf, but on each page it appears with a top margin, or some sort of a header.
Setting these values appears to have solved my issue.
converter.Options.WebPageHeight = 1050;
converter.Options.WebPageWidth = 750;
and i had duplicated values in these, which said true.
converter.Options.DisplayHeader = false;
converter.Options.DisplayFooter = false;

Add Header and Footer Image in PDF using docraptor c#

I am using docraptor (https://docraptor.com/samples) for creating the PDF but I am not able to add Image as Header and Footer into generated PDF.
I have below Html and I am using AJAX to call the API and passing below HTML as content to crate a pad but its not adding Image in Footer and header . Its adding it as like content.
var data = $('#container-abc').html();
<!DOCTYPE html>
<head>
<style type="text/css">
/* setup the page */
##page {
size: US-Letter;
margin: 0 0 35mm 0;
background: #ffffff;
}
/* setup the footer */
##page {
##bottom {
content: flow(footer);
}
}
footer {
flow: static(footer);
}
body {
border-top: 10px solid #3877B1;
font-family: "myriad-pro-1", "myriad-pro-2", sans-serif;
}
#container {
margin: 0 auto;
}
header, #main {
margin: 15mm;
}
header {
margin-top: 5mm;
border-bottom: 1px solid #7E7E7E;
padding-bottom: 5mm;
}
.seller, .status{
float: left;
}
.buyer {
float: right;
}
.seller {
width: 50%;
}
.buyer {
max-width: 30%;
}
.brand {
font-weight: bold;
font-size: 30px;
color: #333;
padding: 10px 0 2px;
overflow: auto;
}
.brand span, .brand img {
float: left;
}
.brand span {
display: block;
margin: 8px 0 0 5px;
}
.seller address {
clear: both;
display: block;
padding-left: 65px;
ont-size: 10pt;
line-height: 12pt;
color: #262626;
}
.seller address span {
display: block;
}
.status.paid {
margin: 25pt 0 0 15pt;
letter-spacing: -1pt;
font-weight: bold;
color: #78E400;
font-size: 30pt;
border: 5px solid #78E400;
padding: 1pt 5pt;
transform: rotate(-15deg);
-ms-transform: rotate(-15deg); /* IE 9 */
-webkit-transform:rotate(-15deg); /* Safari and Chrome */
}
.buyer {
font-size: 9pt;
line-height: 12pt;
margin-top: 30pt;
color: #262626;
}
.buyer h2 {
font-weight: bold;
font-size: 11pt;
}
.buyer span { display: block; }
/* main */
table {
width: 100%;
}
th {
font-size: 8pt;
color: #919191;
line-height: 14pt;
text-align: left;
padding-left: 10pt;
border-bottom: 1px solid #D6D6D6;
}
th:last-child, td:last-child {
width: 20%;
}
th:last-child {
padding-left: 10mm;
}
td {
padding: 10pt;
border-bottom: 1px solid #D6D6D6;
}
td h4 {
font-weight: bold;
font-size: 12pt;
}
td .description {
font-size: 9pt;
line-height: 14pt;
}
td.price {
vertical-align: middle;
font-size: 12pt;
font-weight: bold;
text-align: right;
}
tr:nth-child(odd) td{
background: #F1F1F1;
}
#notes {
font-size: 9pt;
color: #7E7E7E;
line-height: 14pt;
font-style: italic;
margin-top: 4mm;
padding: 3mm;
float: left;
}
#totals{
padding: 3mm;
float: right;
text-align: right;
font-size: 12pt;
color: #7E7E7E;
line-height: 16pt;
}
/* footer */
footer {
text-align: center;
}
footer p {
background: #F3F3F3;
color: #888;
text-align: center;
font-size: 8pt;
line-height: 12pt;
padding: 7mm 0;
margin-top: 2mm;
}
.clearfix{ clear: both; }
</style>
</head>
<body>
<div id="container-abc">
<header>
<div class="seller">
<h1 class="brand">
<img src="http://docraptor.com/assets/docraptor-logo.svg" width="60" height="43" /> <span>DocRaptor</span>
</h1>
<address>
2885 Sanford Ave SW #13508, Grandville, MI 49418-1342
<span class="email">support#docraptor.com</span>
</address>
</div>
<div class="status paid">PAID</div>
<div class="buyer">
<h2>Billed To</h2>
Super Best Client
<span class="email">superbestclient#example.com</span>
<span class="date">January 20, 2014</span>
</div>
<div class="clearfix"></div>
</header>
<div id="main">
<table>
<thead>
<tr>
<th class="title">Summary</th>
<th class="price">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h4>Max Plan</h4>
<p class="description">March 21, 2014 - April 21, 2014</p>
</td>
<td class="price"><span class="price">$149.00 USD</span></td>
</tr>
<tr>
<td>
<h4>Document Overage</h4>
<p class="description">0 docs $.39</p>
</td>
<td class="price"><span class="price">$0.00 USD</span></td>
</tr>
</tbody>
</table>
<p id="notes">
This charge will appear on your credit card statement as "DOCRAPTOR.COM".
</p>
<div id="totals">
<p>Total: <span class="price">$149.00 USD</span></p>
<p>Due: <span class="price">$0.00 USD</span></p>
</div>
<table>
<thead>
<tr>
<th class="title">Summary</th>
<th class="price">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h4>Max Plan</h4>
<p class="description">March 21, 2014 - April 21, 2014</p>
</td>
<td class="price"><span class="price">$149.00 USD</span></td>
</tr>
<tr>
<td>
<h4>Document Overage</h4>
<p class="description">0 docs $.39</p>
</td>
<td class="price"><span class="price">$0.00 USD</span></td>
</tr>
</tbody>
</table>
<p id="notes">
This charge will appear on your credit card statement as "DOCRAPTOR.COM".
</p>
<div id="totals">
<p>Total: <span class="price">$149.00 USD</span></p>
<p>Due: <span class="price">$0.00 USD</span></p>
</div>
<table>
<thead>
<tr>
<th class="title">Summary</th>
<th class="price">Price</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<h4>Max Plan</h4>
<p class="description">March 21, 2014 - April 21, 2014</p>
</td>
<td class="price"><span class="price">$149.00 USD</span></td>
</tr>
<tr>
<td>
<h4>Document Overage</h4>
<p class="description">0 docs $.39</p>
</td>
<td class="price"><span class="price">$0.00 USD</span></td>
</tr>
</tbody>
</table>
<p id="notes">
This charge will appear on your credit card statement as "DOCRAPTOR.COM".
</p>
<div id="totals">
<p>Total: <span class="price">$149.00 USD</span></p>
<p>Due: <span class="price">$0.00 USD</span></p>
</div>
</div>
<footer>
<img alt="Expected Behavior Logo" height="34" src="https://docraptor.com/assets/expected-behavior-logo.svg" width="150" />
<p>DocRaptor is made and supported by Expected Behavior, LLC<br>1-866-991-3746 | 2885 Sanford Ave SW #13508, Grandville, MI 49418-1342 | support#docraptor.com</p>
</footer>
</div>
</body>
</html>
At least part of the problem is the use of ## as opposed to the singular # when you are handling page and page bottom styles. I changed those to singular and got back a more sane looking PDF from DocRaptor.
Here is a minimal example that has images in the header and footer, on every page.
<html>
<head>
<style type="text/css">
#page {
#top { content: flow(header) };
#bottom { content: flow(footer) };
}
header { flow: static(header); }
footer { flow: static(footer); }
hr { page-break-after: always; }
</style>
</head>
<body>
<header>
<img src="http://i.imgur.com/MtMwkBX.png" />
</header>
<footer>
<img src="http://i.imgur.com/ZZw85mx.png" />
</footer>
<p>This is the first page.</p>
<hr />
<p>This is the second page.</p>
<hr />
<p>This is the third page.</p>
</body>
</html>

How to Read returned XML content and show as HTML in asp.net?

I have a HttpWebRequest from which the remote URL which returns an XML as reponse. Now, i want to parse this XML and read the content and show in to a DIV as HTML content.
Web Request:
protected string GetWebSiteContents(string url)
{
// Create HttpWebRequest
HttpWebRequest httpWebReq = (HttpWebRequest)WebRequest.Create(url);
httpWebReq.UserAgent = ".NET Framework Client";
HttpWebResponse httpWebRes = (HttpWebResponse)httpWebReq.GetResponse();
StreamReader sr = new StreamReader(httpWebRes.GetResponseStream());
// Read the stream a line at a time and place each one into the stringbuilder
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string strLine;
while ((strLine = sr.ReadLine()) != null)
{
// Ignore blank lines
if (strLine.Length > 0)
sb.Append(strLine);
}
sr.Close();
httpWebRes.Close();
return sb.ToString();
}
enter code here
Show into Div:
result.InnerHtml = GetWebSiteContents(url);
From above code i am getting the XML Response from URL sent. Now, i want to show Parse this XML and show data into a DIV say div with id=result with runat=server.
Reuturned XML Response:
<?xml version="1.0" encoding="UTF-8"?><document><cert_link>http://certacell.com/embed/cert.html?certid=SEZQ-5701-X98H-72</cert_link><cert_id>SEZQ-5701-X98H-72</cert_id>**<cert_data>**<div id="certacell_cert"><link
href="http://www.certacell.com/static/css/certificate.bootstrap.css" rel="stylesheet" /><link href="http://www.certacell.com/static/css/certificate.new.css" rel="stylesheet" />
<style> hr { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; border-color: gray; border-image: none; border-right: 0 none; border-style: solid none none;
border-width: 1px 0 0; margin-bottom: 20px; margin-top: 20px;} a { color: #4067f9; text-decoration: none;} </style> <div class="container header col-lg-12" ><img style="margin-top: 1%;"
class="col-lg-3" src="http://www.certacell.com/static/images/cert/logo.png"><h1 style="margin-top: 2%; color: #ffffff; text-shadow: black 0.2em 0.2em 0.3em;" class="" > | Device History
Report</h1></div> <div class="separator container" ></div><div class="content container" style="padding-top: 1%;"><div class="col-lg-6 text-center"
style="padding-top: 4%;"><h4 class=""> Certification Created on: 12 Sep 2013 04:01pm </h4><h4 class=""> Unique Certification ID:</h4><h2 class=""> SEZQ-5701-
X98H-72</h2><div class=""></div> <div class="text-left col-lg-offset-2 clearfix"><hr class="col-lg-9" > <div class="clearfix"></div><span
style="margin-top: 10%; font-size: x-large"> Device Carrier: AT&T Wireless </span> <br class="clearfix"><span style="margin-top: 10%; font-size: x-large"> Device Manufacturer: NA
</span> <br class="clearfix"><span style="margin-top: 10%; font-size: x-large"> Device History: Clean </span></div></div> <div class="col-lg-6"> <br
class="clearfix"><div class="col-lg-offset-1"><div class="row"><img src="http://www.certacell.com/static/images/cert/check.png" class="col pull-left"> <span
style="font-size: large; padding-left: 4%; " class="col-lg-9"> This device is Clear for Activation on AT&T Wireless</span></div> <br class="clearfix"><div
class="row"><img src="http://www.certacell.com/static/images/cert/check.png" class="col pull-left"> <span style="font-size: large; padding-left: 4%;" class="col-lg-9"> This
device is Certified to be an Authentic NA Device</span></div> <br class="clearfix"><div class="row"><img src="http://www.certacell.com/static/images/cert/check.png"
class="col pull-left"> <span style="font-size: large; padding-left: 4%; padding-top: 10px;" class="col-lg-9"> This device has NOT been reported lost or stolen </span></div></div>
<br class="clearfix"><div style="color: gray; font-size: larger">To verify this ceriticate’s authenticity please visit <a href="http://www.certacell.com"
target="_blank">www.CertaCell.com</a>.<br class="clearfix"> Certificate is subject to Certacell <a href="http://www.certacell.com" target="_blank">terms and
conditions.</a></div></div></div><div class="separator container" ></div></div>**</cert_data>**<clean>True</clean></document>
Is it possible to return the data of '**cert_data tag ' and show as html to a DIV ?**
Help appreciated!

Regex expression to update the div's style properties - width & height

Sample string:-
<div class="ui-droppable" id="ParentDIV" style="width: 286pt; height: 212pt; background-color: #00752d; background-image: none;">
<div class="be-canvas-grid" style="background-image: none">
<div style="width: 200px; height: 50px; top: 77px; left: 162px; font-family: Arial; font-size: 12pt; color: rgb(0, 0, 0); overflow: hidden;" data-uid="2" class="be-component be-text ui-draggable ui-droppable">
<span>hello from simple text</span>
</div>
<div style="width: 161.567px; height: 39.5667px; top: 127px; left: 172px; font-family: Arial; font-size: 12pt; color: rgb(201, 87, 201); overflow: hidden;" data-uid="3" class="be-component be-text ui-draggable ui-droppable">
<span>{[C-FULLNAME:LC]}</span>
</div>
<div style="width: auto; height: auto; top: 196px; left: 216px;" data-uid="4" class="be-component be-image ui-draggable">
<img src="https://localhost/a/images/BarcodeType1.jpeg" data-qrstub="" alt="">
</div>
<div style="width: 200px; height: 50px; top: 6px; left: 12px; font-family: Arial; font-size: 12pt; color: rgb(201, 87, 201); overflow: hidden;" data-uid="5" class="be-component be-text ui-draggable ui-droppable">
<span>asd</span>
</div>
</div>
</div>
I want to pull the ParentDIV elements's style properties i.e. width and height. Then I want to update the width and height css properties with my values. The order of height and width properties in the style tag of ParentDIV may get changed also.
Please suggest the regex. I would be making this code changes in C#.net.
Regex expression can build with the help of online tool http://www.gskinner.com/RegExr/.

Categories