While converting from HTML to PDF, I noticed that Gembox Document doesn't recognize the "REPRINT" strings as a vertical.
The following is the HTML code:
<html>
<head>
<style>
.main-container {
text-align: center;
}
.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;
}
.font-bold {
font-weight: bold;
}
.table-class {
width: 100%;
font-size: 14px;
}
td {
width: 50%;
}
.line-left {
text-align: left;
}
.line-right {
text-align: right;
}
.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 {
font-size: 10px;
text-align: left;
}
.mrg-btm-two {
margin-bottom: 64px;
}
.mrg-btm-three {
margin-bottom: 16px;
}
.mrg-btm-four {
margin-bottom: 20px;
}
.mrg-side-left {
margin-left: 2px;
}
.main-table {
width: 100%;
}
.reprint-td {
width: 5%;
writing-mode: vertical-lr;
text-align: center;
letter-spacing: 4px;
font-size: 18px;
font-weight: bold;
}
.main-td {
width: 90%;
}
.reprint-div {
display: inline-block;
height: 100%;
}
</style>
</head>
<body>
<table class="main-table">
<tr>
<td class="reprint-td">
<div class="reprint-div">REPRINT</div>
</td>
<td class="main-td">
<div class="main-container">
<div class="code mrg-btm">
<label>__LABEL1__</label>
</div>
<div class="name-and-code mrg-btm-four">
<label>__LABEL2__ __LABEL3__</label>
</div>
<div class="mrg-btm-four">
<img alt='Barcode Generator TEC-IT' src='https://barcode.tec-it.com/barcode.ashx?data=BARCODE_NUMBER&code=Code39'/>
</div>
<div class="mrg-btm-three">
<table class="table-class">
<tr>
<td class="line-left">SQA_TEXT</td>
<td class="font-bold line-right">METER</td>
</tr>
<tr>
<td class="line-left">GOMSET</td>
<td class="line-right">FIRST_DATA</td>
</tr>
</table>
</div>
<div class="scadenza mrg-btm">
<label>EXPIRE_TEXT</label>
</div>
<div class="data-scadenza mrg-btm">
<label>EXPIRE_DATA</label>
</div>
<div class="materiali mrg-btm">
<label>MATERIALS_TEXT</label>
</div>
<div class="last-codes mrg-btm-two">
<label class="mrg-side-left">RC_NUMBER AFTER_RC</label>
</div>
<div class="last-codes mrg-btm">
<label class="mrg-side-left">SB_CODE STR_CODE SECOND_DATA</label>
</div>
<div class="last-codes">
<label class="mrg-side-left">C_CODE_NUMBER RC_NUMBER AFTER_RC</label>
</div>
</div>
</td>
<td class="reprint-td">
<div class="reprint-div">REPRINT</div>
</td>
</tr>
</table>
</body>
</html>
The following is the result of the HTML code (it is ok):
enter image description here
The following are the C# methods of our interest:
private void convertHtmlToPdf(string filenameHtml)
{
showMessage("Operation in progress...");
string realHtml = replaceIntoTemplate(File.ReadAllText(filenameHtml));
File.WriteAllText(path + htmlFilenameReplaced, realHtml);
GemBox.Document.ComponentInfo.SetLicense(licenseGemboxDocument);
DocumentModel document = DocumentModel.Load(path + htmlFilenameReplaced);
document.DefaultCharacterFormat.FontName = "Verdana";
GemBox.Document.Section section = document.Sections[0];
PageSetup pageSetup = section.PageSetup;
pageSetup.PageWidth = 383.62;
pageSetup.PageHeight = 576.95;
PageMargins pageMargins = pageSetup.PageMargins;
pageMargins.Top = pageMargins.Bottom = 96;
pageMargins.Left = pageMargins.Right = 48;
document.Save(path + pdfFilename);
showMessage("Successfully conversion HTML to PDF");
}
private string replaceIntoTemplate(string templateHtml)
{
string newTemplateHtml = templateHtml;
newTemplateHtml = newTemplateHtml.Replace("__LABEL1__", label1.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("__LABEL2__", label2.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("__LABEL3__", label3.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("BARCODE_NUMBER", barcode.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("SQA_TEXT", sqa.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("METER", meter.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("GOMSET", gomset.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("FIRST_DATA", firstData.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("EXPIRE_TEXT", expireText.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("EXPIRE_DATA", expireData.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("MATERIALS_TEXT", materials.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("RC_NUMBER", rcNumber.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("AFTER_RC", numberAfterRc.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("SB_CODE", sbCode.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("STR_CODE", strCode.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("SECOND_DATA", secondData.Replace(" ", " "));
newTemplateHtml = newTemplateHtml.Replace("C_CODE_NUMBER", cCode.Replace(" ", " "));
return newTemplateHtml;
}
The result of the conversion from HTML to PDF is the following (with the "REPRINT" strings not vertically):
enter image description here
What can I change in the convertHtmlToPdf C# method for obtained the "REPRINT" strings vertically?
Try using this latest bugfix version:
https://www.gemboxsoftware.com/document/nightlybuilds/GBD35v1134.zip
Or this latest NuGet package:
Install-Package GemBox.Document -Version 35.0.1134-hotfix
The writing-mode CSS property in table cells should now be supported.
Fair warning: This post is a bit of an essay-sized question... So let me say my thanks beforehand to whoever goes through it and tries to answer it.
Context:
I have been trying the only 2 free-commercial-use open-source html to pdf converting libraries I could find.
PDFSharp unfortunately outputs a pdf with a completely messy style layout that doesn't respect the formatting of the input HTML and sometimes doesn't output images properly. (How it should've look vs how it looks with PDF#)
TuesPechkin (wkhtmltopdf c# wrapper library) on the other hand does it all right except for only outputting these odd "image containers" (a hollow outline of where the image supposedly should be).
I declare the IConverter object upon calling my class' constructor like so:
converter = new ThreadSafeConverter( new RemotingToolset<PdfToolset>( new Win64EmbeddedDeployment( new TempFolderDeployment())));
Then I have the following method where you can find the GlobalSettings and ObjectSettings I'm currently using for the conversion.
/// <summary>
/// Method for converting an .EML's HTML Body to a PDF
/// </summary>
/// <param name="html">The HTML to be converted</param>
/// <param name="usern">Optional: Username for file naming</param>
/// <param name="idx">Optional: Index for file naming</param>
public void Convert2PDF(string html, string usern = null, int? idx = null)
{
string userName = usern ?? "test";
var document = new HtmlToPdfDocument
{
GlobalSettings =
{
ProduceOutline = true,
DocumentTitle = userName.Split('#')[0] + "__" + idx.Value.ToString(),
PaperSize = PaperKind.A4,
Margins =
{
Left = 6,
Top = 4,
Right = 6,
Bottom = 8,
Unit = Unit.Millimeters
},
UseCompression = false
},
Objects =
{
new ObjectSettings { HtmlText = html,
WebSettings = new WebSettings
{
EnableIntelligentShrinking = false,
DefaultEncoding = "UTF-8",
LoadImages = true,
PrintBackground = true,
},
FooterSettings = new FooterSettings{CenterText = "[page]"},
}
}
};
byte[] bolb = converter.Convert(document);
File.WriteAllBytes(Path.Combine(mailBoxDirPath, ".PDFs", userName.Split('#')[0] + "__" + idx.Value.ToString() + "__with_TuesPechkin__" + ".pdf"), bolb);
/* ↑ TuesPechkin */
/* ↓ PdfSharp */
byte[] blob = null;
using(MemoryStream ms = new MemoryStream())
{
PdfDocument pdf = PdfGenerator.GeneratePdf(html,PageSize.A4,/*margin from border to content ==*/ 0);
pdf.Save(ms);
blob = ms.ToArray();
}
userName = usern ?? "test";
File.WriteAllBytes(Path.Combine(mailBoxDirPath, ".PDFs", userName.Split('#')[0] + "__" + idx.Value.ToString() + "__with_PDF#__" + ".pdf"), blob);
}
This "HTML" string is obtained from the output of another library I'm using called "MailKit/MimeKit" made by "Jstedfast".I take this output and insert my own kind of "formatted header with some of the email's info" while also switching the image's CID every time there's one, with the following code that uses MailKit/MimeKit's tools:
...
foreach (MimePart part in temp.BodyParts)
{
if (!part.IsAttachment && part.ContentId != null)
{
using (Stream stream = new MemoryStream())
{
part.Content.WriteTo(stream);
stream.Flush();
stream.Seek(0, SeekOrigin.Begin);
using (StreamReader sr = new StreamReader(stream))
{
string cid = string.Format("src=\"cid:{0}", part.ContentId);
string data = string.Format("src=\"data:{0}/{1};{2},\n{3}", part.ContentType.MediaType, part.ContentType.MediaSubtype, part.ContentTransferEncoding, sr.ReadToEnd());
rValue.Replace(cid, data);
}
}
}
}
...
Side note: "temp" would be my MimeMessage.
And here would be the whole string-building process for reference. I usually test these outputs on HTML previewers, and they come out without any issues in formatting or image display, so I know the issue isn't my HTML input when trying to convert to PDF:
...
MimeMessage temp = emp.Pop3.GetMessage(idx);
StringBuilder rValue = new StringBuilder(null);
Regex bodyTag = new Regex(#"^<body.*>$");
Regex charset = new Regex("charset=(.*)\"");
string body = string.Empty, condHelper = string.Empty;
List<string> tempBody = temp.HtmlBody.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList<string>();
int tempidx = 0;
foreach (string line in tempBody) // Looks-up this HTML's charset and sets it to utf-8
{
if(charset.IsMatch(line))
{
condHelper = charset.Match(line).Value;
tempidx = tempBody.IndexOf(line);
tempBody[tempidx] = line.Replace(condHelper, "charset=utf-8\"");
break;
}
}
foreach(string line in tempBody) //Looks up the index of the body tag so I append that "custom header" with basic info from the email
{
if (bodyTag.IsMatch(line))
{
tempidx = tempBody.IndexOf(line);
break;
}
}
string line4change = tempBody[tempidx];
line4change += emp.HeaderBuilder(temp.Subject, temp.From.Mailboxes.First(), temp.To.Mailboxes.ToList<MailboxAddress>(), temp.Date.DateTime, temp.Cc.Mailboxes.ToList<MailboxAddress>());
tempBody[tempidx] = line4change;
for (int i = 0; i < tempBody.Count; i++) // starts building the final version of the whole html string
body += tempBody[i] + Environment.NewLine;
rValue.Append(body);
foreach (MimePart part in temp.BodyParts)
{
if (!part.IsAttachment && part.ContentId != null)
{
using (Stream stream = new MemoryStream())
{
part.Content.WriteTo(stream);
stream.Flush();
stream.Seek(0, SeekOrigin.Begin);
using (StreamReader sr = new StreamReader(stream))
{
string cid = string.Format("src=\"cid:{0}", part.ContentId);
string data = string.Format("src=\"data:{0}/{1};{2},\n{3}", part.ContentType.MediaType, part.ContentType.MediaSubtype, part.ContentTransferEncoding, sr.ReadToEnd());
rValue.Replace(cid, data);
}
}
}
}
try
{
emp.Convert2PDF(rValue.ToString(), emp.User, idx);
}
catch { }
...
So, my objective is to fix the odd output of these hollow image containers on the outputted PDF file.
Edit: Here's an example of an HTML string taken directly from the debugger right before it gets sent to the "Convert2PDF" method:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="margin-top:24px;"></div>
<span style="font-family: Segoe UI; font-size: 16; font-weight: bold; "> t est</span><br>
<span><hr style="height: 4px; border: none; margin-top: 2px; margin-bottom: 12px; color:#000; background-color:#000;" /></span>
<table style="margin-bottom:32px; " cellspacing="0" cellpadding="4">
<tr>
<td style="margin-left: auto; padding-right: 128px; white-space: nowrap;"><span style="font-family: Segoe UI; font-size: 14; font-weight: bold; "> From:</span></td>
<td style="white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14;">tester[REDACTED]#outlook.com</span></td>
<td style="width:99%; "></td>
</tr>
<tr style="background-color:#f2f2f2;">
<td style="margin-left: auto; padding-right: 128px; white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14; font-weight: bold;"> Sent:</span></td>
<td style="white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14; ">Monday, 11th of October 2021, 08:52:49</span></td>
<td style="width:99%; "></td>
</tr>
<tr>
<td style="margin-left: auto; padding-right: 128px; white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14; font-weight: bold;"> To:</span></td>
<td style="white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14;">[REDACTED]</span></td>
<td style="width:99%; "></td>
</tr>
<tr style="background-color:#f2f2f2;">
<td style="margin-left: auto; padding-right: 128px; white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14; font-weight: bold;"> Subject:</span></td>
<td style="white-space: nowrap;"><span style="font-family:Segoe UI; font-size: 14;">Testing TuesPechkin Library w/Images</span></td>
<td style="width:99%; "></td>
</tr>
</table>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
1st Inline image:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<img style="width: 187px; height: 221px; max-width: 100%;" size="7198" contenttype="image/png" width="187" height="221" alt="key points of an email" data-outlook-trace="F:1|T:1" src="data:image/png;Base64,
iVBORw0KGgoAAAANSUhEUgAAALsAAADdCAIAAABsX5R6AAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABuzSURBVHhe7Z15WBPHH4edDQEUKYfiUbxaLR54
IYhWi1b9WfHASr1QPKpQarVaLZaqQERQPEFr1QpKq8UDq+CBgE8Vigoo0gcRQfABRX0QCo8ID8JD
8pA8/HJsktlNAlnZmCDf9682k91E5s3szOzOZzo0AQATwBiAGWAMwAwwBmAGGAMwA4wBmAHGAMwA
YwBmgDEAM8AYgBksGSMqP+XlOKJlnHxiXpGHAG0Ttox5vn+icYeWMZ5yqIw8BGibgDEAM8AYgBk6
MoY7dNm+I2qIuJJXTx4CtE10ZIzJtKOVZBHwfqE3Y0Q1T7LSbitIf1DaIH61vjjpwMbl7tOnzVgU
lsGXvVMBv+zfy5E7Nvp4fuXmOnXqtJnui7x+DP4t7t5L+htlqP+EpqY3xdeP8tZ8Pd9t+gz3JWtD
Tqa/FEhfl9JYkX0hfNM3Hl+Kv8IcD+9NBy4+rBaRZTiiurJH/97LeVrVSL7QbtCbMfwb3/XhkO8W
wx0T+qgyNWCsFYFkL5jMPvGGfKv49JUZh73H25qSZVSQqe1nPhH3XtMrVvUTCuqKzq0b151LOQ3i
WDv/lFguPrqhIPqbUV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wC1bAnjBoWFH/oxLvl/abEq+NjH5SkS1xbfOR+wL
4flv8Q8MCg2POHOjQP5ElYGG6bNpTFuhIdYTu7GNTGccM5SnldoC7dCYxgeUKUWj/utuGs4v2PBp
J8aIqvP/LZQOrxufxyzGezFE96VxhjPZ0QZoJ8YIC0LHdO5q5+ziPMCS0tc06r8m+V2vVmrbtCNj
VCcAEMd2wenSt+tkt1varzHIqNvEbbcM5tG2NkN76ceUnV892tZMOi2HOGYfjnBdFX7jOXR434J2
YowMYX3Vyxcvq+rVz74AWtGujAFYAIwBmAHGAMwAYwBmgDEAM8AYgBlgDMAMMAZgQlPT/wHgbtxB
+HbHjAAAAABJRU5ErkJggg==
"><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
2nd Inline image:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<img style="width: 100px; height: 100px; max-width: 100%;" size="967" contenttype="image/png" width="100" height="100" alt="2 dradients" data-outlook-trace="F:1|T:1" src="data:image/png;Base64,
iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANcSURBVHhe7dzJS5RxHMfxb3u2u83q7pj7vhta
Zlbj7FMEBQURFBTUwUNBHTx48OLBg4eCOhQUFEREUBARERFERFppZWWWmeW+tjc95++pub0PA68/
4Mfn8vBsbxlLcET8p8hYYYiMFYbIWGGIjBUGGbOnAw0nZgHJuD0NaDApD0gm7KlA/clFQDJpTwHq
SykDkilbMlBvajWQTNuSgLrTaoFkxpYE9CS9HsgYKxHokaMRSGZtCUAPMpxAMme1A93L9ALJvNUG
dCcrCCTfrFagW9m7gOS71Qp0I2cPkPywWICu5e4Dkp8WM9CVvANAxlgmoEv5h4DklyUe6ELBESD5
bYkDOld4DEj+mOOAzhQ1A8lfcyxQZ8kJIAmZY4A6Sk8BGWNFA7WXtQBJyLQOqK28FcgYay1Qa0Ub
UGSsMEDHaqlsBzLGWgN0sqoDyBhrNdDx6k4gCcWvAmquOQ1kjLUS6OiGs0DGWCuADteeBzLGigI6
WHcRSEJxUUD7N14GMsZaDrR301UgY6xlQLvrrwMZYy0F2rn5JpAx1hIgf8NtIAnFLgZyb7kLBB1r
W+N9IGOsRUANWx8CGWMtBKrb/hhIQjELgGqcT4GMsYgqmp4D6VNCFLteAulTQuS73wDpU0JkewaA
JBRN5PB+AtKnhEjxfQHSp4RI8I8B6VNCmANTQPqUELE75oH0ZQgiLjgHBL03jA/OAkGflJqCM0DQ
94am4DQQ9CsadRmCgH6AawlMAkF/R7EGJoGgP2faAhNA0FSBPTAOJKMJDiB1UwYhqk0DkegfBRLV
poFI9I8AiWrTQCT5R4BEtWkgkn1fgUS1aSDUI0oIUW0aiFTfMJCoNg1Emu8zkKg2DUS6bwhIVJsG
wuEdAhLVpoFQL+wgRLVpIDK8g0Ci2jQQ670fgUS1aSAyPR+ARLVpILI8A0Ci2jQQ6vMVCFFtGogc
z3sgUW0aiBxPP5CoNg1ErvsdkKg2DUSe+y2QqDYNhPqYE0JUmwaiwN0HJKpNA1Ho6gMS1aaBKHK9
BhKVW4Eodr0CEpVbgVC/NkCIyq1AlLh6gUTlViBKm3qAROVWIMqaeoBE5VYgypteAInKrUCoH/0g
ROVWICqdz4BE5VYgqpzdQKJyKxBVzi4gUbkViGpnF46z6x+zRQbPWHJSYgAAAABJRU5ErkJggg==
"><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Stylized text:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Georgia, serif; color: rgb(179, 106, 226);"><b><i><u><strike>S o m e T e x t</strike></u></i></b></span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: Georgia, serif; color: rgb(179, 106, 226);"><b><i><u><strike><br>
</strike></u></i></b></span></div>
</body>
</html>
I have been using the following site to test these HTML strings making sure their formatting and images are displaying correctly: https://www.onlinehtmleditor.net/
I tested your HTML using NuGet package itext7.pdfhtml and the images didn't show either. However after some investigation, I discovered an issue with the value in the src property.
In the src property value you have data:image/png;Base64. It should be data:image/png;base64 - notice the lower-case b for base64.
After changing Base64 to base64 it seems to work.
<img style="width: 187px; height: 221px; max-width: 100%;" size="7198" contenttype="image/png" width="187" height="221" alt="key points of an email" data-outlook-trace="F:1|T:1" src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAALsAAADdCAIAAABsX5R6AAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABuzSURBVHhe7Z15WBPHH4edDQEUKYfiUbxaLR54
IYhWi1b9WfHASr1QPKpQarVaLZaqQERQPEFr1QpKq8UDq+CBgE8Vigoo0gcRQfABRX0QCo8ID8JD
8pA8/HJsktlNAlnZmCDf9682k91E5s3szOzOZzo0AQATwBiAGWAMwAwwBmAGGAMwA4wBmAHGAMwA
YwBmgDEAM8AYgBksGSMqP+XlOKJlnHxiXpGHAG0Ttox5vn+icYeWMZ5yqIw8BGibgDEAM8AYgBk6
MoY7dNm+I2qIuJJXTx4CtE10ZIzJtKOVZBHwfqE3Y0Q1T7LSbitIf1DaIH61vjjpwMbl7tOnzVgU
lsGXvVMBv+zfy5E7Nvp4fuXmOnXqtJnui7x+DP4t7t5L+htlqP+EpqY3xdeP8tZ8Pd9t+gz3JWtD
Tqa/FEhfl9JYkX0hfN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MvgJ+4ZnvnOnvJo0x4DB9VowhEdaUZKdcPh2xf9f2oEB/
f17Qjt2/HItJSMv/r8WBgKi6MOXM4V1BAYHBe4+cSSmqpVWylohqHqecObSTF8AL2fvrias5FSrd
SQn866uUt4fExozfU6xS+1Iaqwpvxv3+y86gwC1bAnjBoWFH/oxLvl/abEq+NjH5SkS1xbfOR+wL
4flv8Q8MCg2POHOjQP5ElYGG6bNpTFuhIdYTu7GNTGccM5SnldoC7dCYxgeUKUWj/utuGs4v2PBp
J8aIqvP/LZQOrxufxyzGezFE96VxhjPZ0QZoJ8YIC0LHdO5q5+ziPMCS0tc06r8m+V2vVmrbtCNj
VCcAEMd2wenSt+tkt1varzHIqNvEbbcM5tG2NkN76ceUnV892tZMOi2HOGYfjnBdFX7jOXR434J2
YowMYX3Vyxcvq+rVz74AWtGujAFYAIwBmAHGAMwAYwBmgDEAM8AYgBlgDMAMMAZgQlPT/wHgbtxB
+HbHjAAAAABJRU5ErkJggg==
">
I am at my wits end.
The following code displays a pdf to the user based on a query string and pulls the pdf from a file server. It works great in google chrome. However, I need this to work in IE as well.
When I use IE, it just shows a blank space where the pdf should be. Below is my aspx and C# file. Both browsers have adobe reader addons installed.
FRONT END:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JobBookViewer.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Job Book Viewer</title>
<style type="text/css">
#form1 {
font-weight: 700;
width: 118px;
height: 217px;
margin-top: 15px;
}
</style>
<script type="text/javascript">
function SetPDFwindow()
{
var varclientscreenwidth = screen.width;
var varclientscreenheight = screen.height;
}
</script>
</head>
<body onload="SetPDFwindow()">
<form id="form1" runat="server">
<div style="width: 203px; z-index: 1; left: 7px; top: 4px; position: relative; height: 34px; right: 811px;">
<asp:Button ID="ButtonAbout" runat="server" BackColor="#B0F1FF" style="z-index: 1; left: 873px; top: 1px; position: absolute" Text="About" OnClick="ButtonAbout_Click" Visible="false" />
<asp:ListBox ID="ListBox1" runat="server" style="z-index: 1; left: 735px; top: 41px; position: absolute; width: 206px; height: 447px;" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged" AutoPostBack =" true"></asp:ListBox>
</div>
<div id="chromecheck" runat="server" visible="false">
Chrome
</div>
<div id="iecheck" runat="server" visible="false">
We have detected that you are not using Chrome. If the program is not working, please switch to Chrome
</div>
<object data="data:application/pdf;base64
, <%= this.file %>" type="application/pdf"
style="z-index: 1; left: -3px; top: 1px; height: 210%; width: 612%; margin-top: 1px;" id="myPDF"></object>
<p>
</p>
</form>
</body>
</html>
CODE BEHIND:
using System;
using System.Web.UI.WebControls;
using System.IO;
using System.Drawing;
namespace JobBookViewer
{
public partial class WebForm1 : System.Web.UI.Page
{
public String file;
public String id;
protected void Page_Load(object sender, EventArgs e)
{
System.Web.HttpBrowserCapabilities browser;
browser = Request.Browser;
if (browser.Browser.ToLower().Equals("chrome"))
{
chromecheck.Visible = true;
}
else
{
iecheck.Visible = true;
}
if (!IsPostBack)
{
// myPDF.Style.Add("width", (Convert.ToInt32(clientScreenWidth.Value)-200).ToString());
file = fnFilePDFName(#"\\spfs1\stone\Long Term Share\db_objects\JobBookViewer\select_mold.pdf");
try
{
if (!String.IsNullOrEmpty(Page.Request.QueryString["MoldID"])) // if the string is not null
{
id = (Page.Request.QueryString["MoldID"]);
ListBox1.Items.Clear();
System.IO.DirectoryInfo dinfo = new System.IO.DirectoryInfo(#"\\spfs1\stone\mold_books\" + id.ToString());
System.IO.FileInfo[] Files = dinfo.GetFiles("*.pdf");
foreach (System.IO.FileInfo file in Files)
{
ListBox1.Items.Add(file.Name);
}
}
}
catch { }
}
}
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
file = fnFilePDFName(#"\\spfs1\stone\mold_books\" + Page.Request.QueryString["MoldID"] + #"\" + ListBox1.SelectedValue);
}
private string ModifyQueryStringValue(string p_Name, string p_NewValue)
{
var nameValues = System.Web.HttpUtility.ParseQueryString(Request.QueryString.ToString());
nameValues.Set(p_Name, p_NewValue);
string url = Request.Url.AbsolutePath;
string updatedQueryString = "?" + nameValues.ToString();
return url + updatedQueryString;
}
public string fnFilePDFName(string path)
{
string sfileContent;
Byte[] bytes = File.ReadAllBytes(path);
sfileContent = Convert.ToBase64String(bytes);
return sfileContent;
}
}
}
I am trying to convert an HTML with CSS in to Pdf and it has been successful. But once I tried to add an image to a div from a CSS the Converted Pdf won't show the image
This is my code
For Pdf Content Type
using System;
using System.IO;
using System.Web.Mvc;
namespace MvcApplication1.Helpers
{
public class PdfContent : ActionResult
{
public MemoryStream MemoryStream { get; set; }
public string FileName { get; set; }
public override void ExecuteResult(ControllerContext context)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
var response = context.HttpContext.Response;
response.ContentType = "pdf/application";
response.AddHeader("content-disposition", "attachment;filename=" + FileName + ".pdf");
response.OutputStream.Write(MemoryStream.GetBuffer(), 0, MemoryStream.GetBuffer().Length);
}
}
}
The Action which Invoke the Pdf
public ActionResult GeneratePdf()
{
var cssText = System.IO.File.ReadAllText(#"C:\Users\sansa\Desktop\Ground Operations\HTMLResources\grace.css");
var htmlText = System.IO.File.ReadAllText(#"C:\Users\sansa\Desktop\Ground Operations\HTMLResources\grace.html");
var cssArray = cssText.Trim().Split('}');
var cssClassesString = string.Join("} ", cssArray);
var memoryStream = new MemoryStream();
var document = new Document();
var writer = PdfWriter.GetInstance(document, memoryStream);
document.Open();
using (var cssMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(cssClassesString)))
{
using (var htmlMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(htmlText)))
{
XMLWorkerHelper.GetInstance().ParseXHtml(writer, document, htmlMemoryStream, cssMemoryStream);
}
}
document.Close();
var pdfContent = new PdfContent
{
MemoryStream = memoryStream,
FileName = "SomeName"
};
return pdfContent;
}
The CSS classes
.main_div{background-color:#F8F8F8; vertical-align:center; z-index:1000000; border-width:1px; border-style:solid ;border-radius: 2px;border-color: #E0E0E0; width:400px; height:200px}
.text_one{color: #003300;}
.text_two{color: #0000ca;}
.text_three{color: #e40000;}
.tbl_page{
margin-top: 5px;
color: black;
background-color: cornsilk;
display: block;
border-style: solid;
border-color: wheat;
border-width: 1px;;
border-radius: 5px;
font-family: "Times New Roman", Times, serif;
font-size: 12px;
white-space: normal;
line-height: normal;
}
.tbl_cell{
background-color: honeydew;
}
td, th {
display: table-cell;
}
.tbr_raw{
background-color: #66CCFF;
text-align: center;
}
.image_div_background{
background-image: url('violin-clip-art-violin-clip-art-1.jpg');
height: 400px; width: 400px;
}
This code will generate a clean HTML to Pdf Conversion
Except it won't show the image which applied for the div's background in the converted file
I am also tried to assign image to div via CSS but not working so when I am tried to add img tag with scr attribute inside div tag then it will work for me
try this
<div class="image_div_background">
<img scr="www.yourDomineName.com/violin-clip-art-violin-clip-art-1.jpg"/>
<div>
hope fully it will work for you
i have serched all over the web and didnt find anything like what i am doing or any solution to my problam.
i have an xsd file that connects to mdb and i want to show 10 resukts at a time and to have the ability to page throw all the results,for now the status is that i get 62 results per page and when i am trying to go to the next page i dont recive any results.
what is wrong in my code
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs"
Inherits="FaceBookSearchN.MainPage" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%--<%# Register Src="~/ResultsControl.ascx" TagPrefix="Results" TagName="ResultsControl" %>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
.accordionHeader
{
border: 1px solid blue;
color: White;
background-color: #5078B3;
font-family: Arial,Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}
.accordionHeader a, .accordionHeaderSelected a
{
color: #ffffff;
background: none;
text-decoration: none;
}
.accordionHeader a:hover, .accordionHeaderSelected a:hover
{
background: none;
text-decoration: underline;
}
.accordionHeaderSelected
{
border: 1px solid #2f4f4f;
color: White;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
cursor: pointer;
}
.accordionContent
{
background-color: White;
border: 1px solid,#2f4f4f;
border-top: none;
padding: 5px;
padding-top: 10px;
}
</style>
<title></title>
</head>
<body dir="rtl">
<form id="form1" runat="server">
<div>
<table width="520px">
<tr>
<td>
<table width="100%">
<tr>
<td>
<asp:Label runat="server" Text="תחום" ID="lblProffesion"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:DropDownList runat="server" ID="ddlProffesion" DataTextField="profession_name"
DataValueField="profession_id" OnSelectedIndexChanged="ddlProffesion_SelectedIndexChanged"
AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
</table>
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:Label runat="server" Text="אזור" ID="lblArea"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:DropDownList runat="server" ID="ddlArea" DataValueField="id_area" DataTextField="name_area"
AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%">
<tr>
<td>
<asp:Label runat="server" Text="תפקיד" ID="lblSubProffesion"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:DropDownList runat="server" ID="ddlSubProffesion" DataValueField="tat_pofession_id"
DataTextField="tat_pofession_name" AutoPostBack="true">
</asp:DropDownList>
</td>
</tr>
</table>
</td>
<td>
<table width="100%">
<tr>
<td>
<asp:Label runat="server" Text="אזור כתיבה חופשי" ID="lblFreetext"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtFreetext"></asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button runat="server" Text="חיפוש" ID="btnSearch" OnClick="btnSearch_Click" />
</td>
</tr>
</table>
<div style="width: 520px">
<table width="520px" id="tblHeader" runat="server" style="background-color: #5078B3;
height: 25px">
<tr>
<td>
<asp:Label runat="server" ID="lblJobNum" Text="מס' משרה"></asp:Label>
</td>
<td>
<asp:Label runat="server" ID="lblJobName" Text="שם משרה"></asp:Label>
</td>
<td>
<asp:Label runat="server" ID="lblJobArea" Text="אזור עבודה"></asp:Label>
</td>
</tr>
</table>
<asp:Accordion ID="Accordion1" runat="server" AutoSize="None" FramesPerSecond="40" SelectedIndex="0" TransitionDuration="100"
FadeTransitions="true" RequireOpenedPane="true" SuppressHeaderPostbacks="true"
ContentCssClass="accordionContent" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected">
</asp:Accordion>
<asp:Label ID="lblCurrentPage" runat="server"></asp:Label>
<asp:Button ID="btnPrev" runat="server" Text=" << " />
<asp:Button ID="btnNext" runat="server" Text=" >> " />
</div>
</div>
<asp:ToolkitScriptManager ID="Toolkitscriptmanager1" runat="server">
</asp:ToolkitScriptManager>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.UI.HtmlControls;
namespace FaceBookSearchN
{
public partial class MainPage : System.Web.UI.Page
{
private DataConnectionTableAdapters.table_professionTableAdapter adapterProf;
private DataConnectionTableAdapters.table_profession_tatTableAdapter adapterSubProf;
private DataConnectionTableAdapters.table_areaTableAdapter adapterArea;
private DataConnectionTableAdapters.ordersTableAdapter adapterOrdersNoParams;
private DataConnectionTableAdapters.ordersWithParamsTableAdapter adapterOrdersWithParams;
private DataConnection.table_professionDataTable profDT;
private DataConnection.table_profession_tatDataTable SubProfDT;
private DataConnection.table_areaDataTable areaDT;
private DataConnection.ordersDataTable ordersNoParamsDT;
private DataConnection.ordersWithParamsDataTable ordersWithParamsDT;
PagedDataSource pds;
public int CurrentPage
{
get
{
object o = this.ViewState["CurrentPage"];
if (o == null)
return 0;
else
return (int)o;
}
set
{
this.ViewState["CurrentPage"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
OnLoad();
}
}
protected void OnLoad()
{
tblHeader.Visible = false;
profDT = new DataConnection.table_professionDataTable();
adapterProf = new DataConnectionTableAdapters.table_professionTableAdapter();
areaDT = new DataConnection.table_areaDataTable();
adapterArea = new DataConnectionTableAdapters.table_areaTableAdapter();
adapterProf.Fill(profDT);
adapterArea.Fill(areaDT);
//adapter.Fill(SubProfDT);
ddlProffesion.DataSource = profDT;
ddlProffesion.DataBind();
ddlProffesion.Items.Insert(0,new ListItem("בחר מקצוע", "0"));
ddlArea.DataSource = areaDT;
ddlArea.DataBind();
ddlArea.Items.Insert(0, new ListItem("בחר אזור", "0"));
ddlSubProffesion.Items.Insert(0, new ListItem("בחר תת מקצוע", "0"));
}
protected void ddlProffesion_SelectedIndexChanged(object sender, EventArgs e)
{
SubProfDT = new DataConnection.table_profession_tatDataTable();
adapterSubProf = new DataConnectionTableAdapters.table_profession_tatTableAdapter();
adapterSubProf.GetDataByID(int.Parse(ddlProffesion.SelectedValue));
SubProfDT = adapterSubProf.GetDataByID(int.Parse(ddlProffesion.SelectedValue));
ddlSubProffesion.DataSource = SubProfDT;
ddlSubProffesion.DataBind();
//ddlSubProffesion.Items.Insert(0, new ListItem("בחר תת מקצוע", "0"));
}
protected void btnSearch_Click(object sender, EventArgs e)
{
tblHeader.Visible = true;
if (int.Parse(ddlProffesion.SelectedValue) == 0 && int.Parse(ddlArea.SelectedValue) == 0)
{
ordersNoParamsDT = new DataConnection.ordersDataTable();
adapterOrdersNoParams = new DataConnectionTableAdapters.ordersTableAdapter();
adapterOrdersNoParams.FillOrdersNoParams(ordersNoParamsDT);
DataTable dt = new DataTable();
dt = ordersNoParamsDT;
pds = new PagedDataSource();
pds.DataSource = dt.DefaultView;
pds.AllowPaging = true;
pds.PageSize = 10;
pds.CurrentPageIndex = CurrentPage;
lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " " + "of" + " " + pds.PageCount.ToString();
btnPrev.Enabled = !pds.IsFirstPage;
btnNext.Enabled = !pds.IsLastPage;
ViewState["totalpages"] = pds.PageCount;
for (int i = 0; i < pds.PageCount; i++)
{
FileUpload fu = new FileUpload();
Button btnSubmit = new Button();
btnSubmit.Text = "שלח קורות חיים";
AjaxControlToolkit.AccordionPane pn;
pn = new AjaxControlToolkit.AccordionPane();
pn.ID = "pane" + i;
Label lblTitle = new Label();
Label lblJobName = new Label();
Label lblDesc = new Label();
lblTitle.Text = dt.Rows[i]["order_id"].ToString();
lblJobName.Text = dt.Rows[i]["description"].ToString();
//lblDesc.Text = dt.Rows[i]["description"].ToString();
//Accordion1.DataSource = pds;
//Accordion1.DataBind();
pn.HeaderContainer.Controls.Add(lblTitle);
pn.HeaderContainer.Controls.Add(lblJobName);
HtmlTable tableDesc = new HtmlTable();
HtmlTableRow row;
HtmlTableCell cell;
cell = new HtmlTableCell();
row = new HtmlTableRow();
cell.InnerHtml = dt.Rows[i]["notes"].ToString();
row.Cells.Add(cell);
tableDesc.Rows.Add(row);
fu.Width = Unit.Percentage(100.00);
pn.ContentContainer.Controls.Add(lblDesc);
pn.ContentContainer.Controls.Add(tableDesc);
pn.ContentContainer.Controls.Add(fu);
pn.ContentContainer.Controls.Add(btnSubmit);
Accordion1.Panes.Add(pn);
}
//int i = 0;
//foreach (DataRow dr in ordersNoParamsDT)
//{
// FileUpload fu = new FileUpload();
// AjaxControlToolkit.AccordionPane pn;
// pn = new AjaxControlToolkit.AccordionPane();
// pn.ID = "pane" + i;
// Label lblTitle = new Label();
// Label lblDesc = new Label();
// lblTitle.Text = dr["order_id"].ToString();
// //lblTitle.Text = "מס' משרה" +"|" + "שם משרה" +"|"+ "אזור עבודה"+ "|";
// pn.HeaderContainer.Controls.Add(lblTitle);
// lblDesc.Text = dr["description"].ToString();
// //pn.ContentContainer.Controls.Add(lblDesc);
// HtmlTable tableDesc = new HtmlTable();
// HtmlTableRow row;
// HtmlTableCell cell;
// HtmlTableCell cell2;
// cell = new HtmlTableCell();
// cell2 = new HtmlTableCell();
// row = new HtmlTableRow();
// cell.InnerHtml = dr["notes"].ToString();
// fu.Width = Unit.Percentage(100.00);
// cell2.Controls.Add(fu);
// row.Cells.Add(cell);
// tableDesc.Rows.Add(row);
// pn.ContentContainer.Controls.Add(tableDesc);
// Accordion1.Panes.Add(pn);
// i++;
//}
//Accordion1.DataSource = new System.Data.DataTableReader(ordersNoParamsDT);
//Accordion1.DataBind();
//ucResults.Proffesion = int.Parse(ddlProffesion.SelectedValue);
//ucResults.SubProffesion = 0;
//ucResults.Area = int.Parse(ddlArea.SelectedValue);
}
else
{
// ucResults.Proffesion = int.Parse(ddlProffesion.SelectedValue);
// ucResults.SubProffesion = int.Parse(ddlSubProffesion.SelectedValue);
// ucResults.Area = int.Parse(ddlArea.SelectedValue);
}
}
private void btnPrev_Click(object sender, System.EventArgs e)
{
// Set viewstate variable to the previous page
CurrentPage -= 1;
// Reload control
//ItemsGet();
}
private void btnNext_Click(object sender, System.EventArgs e)
{
// Set viewstate variable to the next page
CurrentPage += 1;
// Reload control
//ItemsGet();
}
}
}
Your OnLoad() method only triggers during the first page load. The data needs to be rebound every time the page is changed. Try removing the if(!IsPostBack) from the Page_Load method and see if it works.