Controls :: ITextSharp Error - HTMLWorker Is Obsolete
May 7, 2015I have tried sample to this address: [URL] ....
But for the obsolete methods in title I have some problem with style, do you have some sample with update?
I have tried sample to this address: [URL] ....
But for the obsolete methods in title I have some problem with style, do you have some sample with update?
i refer u r code but it given m error as The document has no pages.
View 1 RepliesHow to save webpage as pdf... Am using asp.net 4.0 and oracle 10g. and code behind language as vb.net.I have one button. that converts the web page to pdf.It shows Could not find file 'C:....' in htmlparser.Parse(sr) error...
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment;filename=psno.pdf")
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Dim sw As New StringWriter()
[code].....
I am having an aspx page with controls as textbox ,tables ,checkbox etc .I need to convert the webpage to pdf file by a button click .I am using Itextsharp in it. when the button click event fires it shows the error as Font size too small: 0 near htmlparser.Parse(sr);
So how to rectify it .the code used for button click is :
protected void Button1_Click(object sender, EventArgs e) {
Response.ContentType =
"application/pdf";
Response.AddHeader(
"content-disposition", "attachment;filename=TestPage.pdf");
[Code] ....
Error : Could not find a part of the path 'C:Images2.jpg'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:Images2.jpg'.
Source Error:
Line 86: pdfDoc.Open();
Line 87:
Line 88: htmlparser.Parse(sr); Line 89:
Line 90: pdfDoc.Close();
I convert my webpage to pdf i got this error
Server Error in '/POD/POMLNT' Application.
--------------------------------------------------------------------------------
Could not find a part of the path 'c:windowssystem32inetsrvPOMLNTImagesPhotos333827.jpg'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:windowssystem32inetsrvPOMLNTImagesPhotos333827.jpg'.
Source Error:
Line 270: PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
Line 271: pdfDoc.Open()
Line 272: htmlparser.Parse(sr)
Line 273: pdfDoc.Close()
Line 274: Response.Write(pdfDoc)
Source File: D:websitesDevelopmentalPODPOMLNTPOMLNTonepage.aspx.vb Line: 272
When I click the button it's giving an error "Illegal characters in path.",instead opening the pdf file
protected void Button2_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=TestPage1.pdf");
[Code].....
I tried ur code , but it show an error ....
pagesize is ambiguous , imported from the namespace or types 'iTextsharp.text.document,iTextsharp.text
Dim pdfDoc AsNew Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)
I am trying to make a pdf file but this exception show up
unauthorizedaccessexception
In this code
pdfw = PdfWriter.GetInstance(document, New FileStream(ruta, FileMode.Create, FileAccess.Write, FileShare.None))
I am using a <a href=[URL], an open source e-commerce platform, for one of my projects, and I noticed that they use Master Pages as well as user controls. When I looked some of this up, some people made it appear as if Master Pages were intended to replace user controls. Is this true? In my opinion, if I were to start an ASP.NET app from scratch, I would think a Master Page would be enough, but I guess user controls could be utilized.
View 2 RepliesI found the next iTextSharp Code in your site,
But have some Problems
The First One is there are some way to use it with CSS ?
When they initialize the resource manager they create a new ResourceSets hashtable which they use to store all the culture-specific resource sets. Then they override ResouceSets passing in the culture in order to get a resource set for a specific culture. OK so far.
Problem is with creating the hash table in the Initialize method; the compiler complains that ResourceSets is obsolete (new with 4.0) and I am instructed to call InternalGetResourceSet() instead.
[code]....
I have a System.Web.UI.WebControls.Xml control (Xml1) in a webforms app that I have upgraded from .NET 2.0 to .NET 4.0
I am getting two warnings from the code-behind page that I'd like to do something about.
[code]....
'Public Property Document As System.Xml.XmlDocument' is obsolete: 'The recommended alternative is the XPathNavigator property. Create a System.Xml.XPath.XPathDocument and call CreateNavigator() to create an XPathNavigator.
What is this warninghow can i solve it'AjaxControlToolkit.AutoCompleteExtender.CompletionListElementID' is obsolete: 'Instead of passing in CompletionListElementID, use the default flyout and style that using the CssClass properties.
View 7 Replies I am developing a webservice using asp.net 2.0 and WSE3.0 and I hit some problem retrieving the mustUnderstand from the soapRequest envelope returned to us(We are acting as the service provider).
A soapRequest will be returned to us as shown below:
[Code]....
I have the following Sub Routine in my vb.net project which runs fine, but I constantly get build warnings:
[code]....
I think it would be best if I used the correct method. I have followed the instructions here - [URL] but it didn't make a great amount of sense.
[code]....
It looks that the old SqlHelper class from the Microsoft Enterprise Library has been mostly replaced by the Database class which is included in the new Enterprise Library version 5.
I have a very simple and trivial example:
using Microsoft.ApplicationBlocks.Data;
private void PopulateCheckBoxGroup()
{
const string strConnTxt = "Server=(local);Database=DataBindTests;Integrated Security=True;";
const string strlSql = "select Technology from PreferredTechnology where ParentId = 1";
CheckBoxList1.DataSource = SqlHelper.ExecuteReader(strConnTxt, CommandType.Text, strlSql);
CheckBoxList1.DataTextField = "Technology";
CheckBoxList1.DataBind();
}
//Read string contents using stream reader and convert html to parsed conent var parsedHtmlElements = HTMLWorker.ParseToList(new StringReader(contents), null);
//Get each array values from parsed elements and add to the PDF document foreach (var htmlElement in parsedHtmlElements) pdfDoc.Add(htmlElement as IElement);
//Close your PDF pdfDoc.Close(); Response.ContentType = "application/pdf";
//Set default file Name as current datetime Response.AddHeader("content-disposition",
[Code] ....
Error: Input string was not in a correct format. Contents in html file giving error ...
How can i add new page in pdf using bellow article.
[URL]..
I am using itextsharp dll to read pdf document. Its working fine for normal Pdf but Scanned document contents are not read.
View 1 Repliesi am making a certificate page using pdf ,my problem is i wamt to know how to make border around whole page
View 1 RepliesI have created one webpage with logo images and data.
<asp:Image ID="Image1" ImageUrl="logo.png" runat="server" Style="height: 58px; width: 180px;" />
and i convert it into pdf file. my data with logo converting pdf format properly.but logo image displayed in large space. how to compress it.my pdf button code is-
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=NewGraphTest.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
[Code].....
how to sens small image in pdf file using code.
When converting an aspx page to pdf using itextsharp external css is not working.I dont want to create tables for exporting to PDf as its a complex design .I am able to generate the pdf but css is not getting applied. I am using the latest relese of itextsharp.dll.
Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As EventArgs)Response.ContentType = "application/pdf"Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf")Response.Cache.SetCacheability(HttpCacheability.NoCache)Dim sw As New StringWriter()Dim hw As New HtmlTextWriter(sw)Me.Page.RenderControl(hw)Dim sr As New StringReader(sw.ToString())Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)Dim htmlparser As New HTMLWorker(pdfDoc)PdfWriter.GetInstance(pdfDoc, Response.OutputStream)pdfDoc.Open()htmlparser.Parse(sr)pdfDoc.Close()Response.Write(pdfDoc)Response.[End]()End Sub
I am using above code but getting error:
htmlparser.Parse(sr)
is not defining proper path for the images:
Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:ImagesLayoutan-Logo.png'.
It create a pdf not exception ! my font in pdf is broken at some chars like 'ộ' 'ế' ..etc.. ! in my CODE this line:
Chunk c1 = new Chunk("Báo cáo thống kê thiết bị", fonttitle);
it show right format ! and it not broken. i can not add a pdftable
I've been following this article [URL] ....
What is the solution to this question.
View 1 Replies