|
I need to display the following image in my webpage...
string imageStr = imageFromBase64( responseXMLfromUPS);
this.page.xxx = imageStr;
I have a base64 encoded string from UPS that I need to display on
my web page. Your assistance is appreciated.
Thank you for your help. signed... Linda
xxx
|
|
|
|
|
Depending on the format of the image (i.e. Header, BPP, RGB, RGBA, BGR, etc)
1) Get the size of the image.
2) Create a table
<table border="0" cellpadding="0" cellspacing="0">
3) For each row of the image
<tr>
4) For each col of the image
<td><div style="width: 1px; height: 1px; background-color: colorofthepixel;" /></td>
5) End the row
</tr>
6) End the table
</table>
Should be pretty good likeness.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
hi friends,
iam unable to to export gridview content to pdf using itextsharp.
i surfed through the net but none of them worked for me if any of you provide me the code it would be a great help.
Thanks in Advance,
Praveen
|
|
|
|
|
hi there, I'm also looking into converting html to pdf via iTextSharp for the first time here. Just like to take this oportunity to ask you a question (as my VS is going thru an upgrade I havent been able to test this functionality). Are you using this way to convert simple HTML to PDF?
public static void CreatePDFDocument(String strFilePath, String strContent)
{
Document document = new Document(PageSize.A4, 80, 50, 30, 65);
try
{
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(strFilePath, FileMode.Create));
XmlTextReader reader = new XmlTextReader(new StringReader(strContent));
reader.WhitespaceHandling = System.Xml.WhitespaceHandling.None;
HtmlParser.Parse(document, reader);
}
catch (Exception e)
{
throw e;
}
}
|
|
|
|
|
hi,
pls use the code below and chnage it according to ur requirement.Ther grid im using is having 3 columns thats y ive given
iTextSharp.text.Table datatable = new iTextSharp.text.Table(3);
code
-----
using iTextSharp.text;
using iTextSharp.text.pdf;
public void export()
{
Document document = new Document(PageSize.A4, 0, 0, 50, 50);
System.IO.MemoryStream msReport = new System.IO.MemoryStream();
var fetchtest = from a in dc.SE_Tests
select new
{
a.Test_Code,
a.Test_Name,
a.Test_Credits
};
DataTable dt = ObtainDataTableFromIEnumerable((IEnumerable)fetchtest);
try
{
// creation of the different writers
PdfWriter writer = PdfWriter.GetInstance(document, msReport);
// we add some meta information to the document
document.Open();
iTextSharp.text.Table datatable = new iTextSharp.text.Table(3);
datatable.Padding = 2;
datatable.Spacing = 0;
float[] headerwidths = { 10, 10, 10};
datatable.Widths = headerwidths;
// These cells span 2 rows
datatable.DefaultCellBorderWidth = 1;
datatable.DefaultHorizontalAlignment = 1;
datatable.AddCell("Test_Code");
datatable.AddCell(new Phrase("Test_Name", FontFactory.GetFont(FontFactory.HELVETICA, 14, Font.NORMAL)));
datatable.AddCell("Credits");
datatable.DefaultCellBorderWidth = 1;
;
for (int i = 0; i < dt.Rows.Count; i++)
{
datatable.AddCell(new Cell(dt.Rows[i]["Test_Code"].ToString()), i+1,0);
datatable.AddCell(new Cell(dt.Rows[i]["Test_Name"].ToString()), i+1,1);
datatable.AddCell(new Cell(dt.Rows[i]["Test_Credits"].ToString()),i+1,2 );
}
document.Add(datatable);
}
catch (Exception e)
{
Console.Error.WriteLine(e.Message);
}
// we close the document
document.Close();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Export.pdf");
Response.ContentType = "application/pdf";
Response.BinaryWrite(msReport.ToArray());
Response.End();
}
T.Balaji
|
|
|
|
|
|
Better, if you ask same third party for solution.
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
I have an MVC web app and upon successful provider validation I use the following code:
FormsAuth.SetAuthCookie(userName, rememberMe ?? false);
return View()
I set a breakpoint after FormsAuth.SetAuthCookie and the Request has the cookie but HttpContext.User.Identity.IsAuthenticated is false.
When the page reloads there is no cookie and HttpContext.User.Identity.IsAuthenticated is still false.
It seems like I may be missing a step here. Any suggestions?
|
|
|
|
|
Have you tried FormsAuthentication.RedirectFromLoginPage(userName, RememberMe);
Alexei Rodriguez
|
|
|
|
|
So after I call FormsAuthentication.SetAuthCookie, should the following code return true immediately aftwards?
HttpContext.User.Identity.IsAuthenticated
If not then at what point should this code return true?
|
|
|
|
|
Im not sure
Once i had a login control and i was checking the User.Identity.Name inside the LoggedIn Event of the login control, but it wasnt returning the expected value
I then redirected the user to another page and there i would read the User.Identity.Name
Alexei Rodriguez
|
|
|
|
|
I'd like to know the rule on this so I can intelligently speak about it.
So is User.Identity.IsAuthenticated = true only after a redirect to a different page after authentication? For this to work does the redirect have to be with FormsAuthentication.RedirectFromLoginPage()?
|
|
|
|
|
When I am in a browser page I can hit the Print button on the browser toolbar and print the current page. The problem is that when I do this, sometimes not all of the page, usually the right hand side, does not get printed. Is there a way to capture the page, re-format it so that I can print the intire page and then print it. I have seen it done on my banking account, so I know that it can be done.
Thanks,
C# Spock
|
|
|
|
|
If it's a site you are coding, you can add a css file specifying which parts of the page to print and which to hide during print - eg
<link href="print.css" type="text/css" rel="stylesheet" media="print">
and within print.css you might, for example, set
#navigation { display:none; }
to hide your <div id="navigation"> bar...
...
If it's someone else's site, all you can really do is copy/paste the entire page into Word, say, and re-format it there before printing...
|
|
|
|
|
All
I have a web service that has been working fine until yesterday evening, I don't remember making any changes, but for some reason since yesterday evening I am getting the message "WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property." with inner exception as "Root Element Missing". I checked the xml file generated and can't find anything mistakes in it. I am using the same machine as client/server so there is no point of time difference.
Appreciate your help
Sri
|
|
|
|
|
Either the xml file is malformed or it's blank. Sounds like it's not blank, so if you could post it we might be able to spot the problem.
- S
50 cups of coffee and you know it's on!
A post a day, keeps the white coats away!
|
|
|
|
|
hello all how do i draw aline between 2 buttons in asp.net
i am adding to my application tow buttons dynamicaly
and trieng to drow aline between them by bitmap
when i draw the line the buttond disapear
so what to do
your help please
if you please aswer to
adnan.fast@gmail.com
|
|
|
|
|
use tag to draw a line in aspx
Ashok
|
|
|
|
|
hello all how do i draw aline between 2 buttons in asp.net
i am adding to my application tow buttons dynamicaly
and trieng to drow aline between them by bitmap
when i draw the line the buttond disapear
so what to do
your help please
|
|
|
|
|
Hello,
I have an application that creates a certain number of textbox controls (based on a number specified by a user) at runtime. I have the textboxes being created in the page_load method. I have created a another TextBox object to find the created controls and retrieve the text. I then pass the text to a string object. My issue is that when I try to retrieve the values inputted into the textboxes by a user, I receive an 'Object reference not set to instance'. I have provided code below. Any assistance will be great. Thanks in advance.
for (int i = 0; i < numberOf; i++)
{
TextBox tb = ((TextBox)Page.FindControl("txtName" + (i+1).ToString())) as TextBox;
results += tb.Text //this is where error occurs.
Response.Write(results);
}
|
|
|
|
|
Are you sure you have assigned IDs to these generated textboxes?
Regards,
Syed Mehroz Alam
|
|
|
|
|
Hi,
I have written a loop to find the controls within the page and they have assigned ID's (as indicated by the output from the loop). Just can't get the values from them. ???
|
|
|
|
|
Code is OK and it works for me.
In which even u are calling that loop?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Actually, I have figured it out. I was referencing the Page class when I actually did not need to TextBox tb = ((TextBox)Page.FindControl("txtName" + (i+1).ToString())) as TextBox; I just removed it and now it works.
|
|
|
|
|
Hi There,
I'm just starting learning ASP.NET AJAX. I'm creating a web service to access in my ASP.NET AJAX application. But I don't get ref to System.Web.Script.Services.ScriptService attribute in the webservice application. I'm using VS 2005 and installed ASP.NET AJAX 1.0. Don't know what I'm missing. Could you guys help me find this?
thanks in advance
Muthu.
|
|
|
|