C# - Create Pdf From Persian Html File By ITextSharp
Feb 8, 2011
I use ITextSharp library to convert html to pdf. My users use persian language sentence in her/his html files, So this library can't convert persian word.
For resolve this and right to left problem i use bellow code:
[Code]....
My right to left and convert persian words was resolved, but it have another problem.
My algorithm can't parse and convert content of table tag that uses in html file.
Now the question is: How to parse html file that have table tag, div and paragraph tag with persian language sentence, and convert it to pdf?
I am using itextsharp-5.0.2-dll trying to create pdf from html. In that I am using HtmlParser, I dont know what should I import for this. still It getting error due to this.
I am creating an ASP.net website where some articles can be uploaded. I need that my users can get PDF version of it by clicking on a button. For this functionality I am using itextSharp. I am considering the following two options.
1. I will create the PDF file once(on first request) and reuse it always by checking for the existence of it.
2. I will create it on the fly and delete it as soon as the PDF file is delivered to the client. The first approach will lead to faster PDF delivery where as the second approach will lead to saving space.
I am also wondering if this can be possible without saving the PDF on the server in the first place.
i have use itextsharp to convert html to pdf(using asp.net C#) and its work in english characters , but when i want to convert html including arabic characters it will give me empty pdf !!
i am using the above code for pdf generation from html text in HTMLEditor(ajax control). If i hardcode a table with each column of different width, into HTMLEditor text than while generating pdf the column get devided equally i.e all column have fixed size on pdf even if i specify some custom width for each column.
I want to generate pdf that can convert html to pdf,also divide table column with specified width. How to do it?
I want to convert my current asp.net page which will be running, to PDF when i click a button present on the page. I have buttons textboxes and text on the page. itextsharp.dll is not showing textboxs and buttons on the page its only showing plain html text.. what should i do?
I have converted a asp.net web page to PDF using itextsharp.
But the alignments i gave in web page and PDF are completely different.
The images i have used in webpage are not displayed in PDF and whatever code i wrote in CSS is not applied to PDF and the text in the CSS got printed in PDF.
How to provide alignments to controls to get my desired design in PDF.
How 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()
I am creating a pdf document with fields from sql database using iTextsharp,after a client inputs information, the next button is pressed each page is saved in new row with page01,page02 etc as a column within that database. I would like iTextsharp to loop and create a new page based on this page number and have one pdf doc. my code is as below.
protected void GenerateReport(object sender, EventArgs e) { DataRow dr = GetData("SELECT * FROM OnSiteWorkTx where DocID = " + DropDownListPdf.SelectedItem.Value).Rows[0]; ;
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 am trying to generate a pdf file using itextsharp in asp.net c#.
I came across table concept in itextsharp n i am trying to use it ie my application. I am having the following problem while using tables.The pdf cell which contains Name of treasery the word treasery comes on next line. I am setting width for each cell. if i increase the width than also no changes come. The gap which is shown using arrow in below image remain as it is al the time. Why is that gap?How to remove that gap?I want a dotted line as a border to only one cell. how to do that?here is my code
PdfPTable line6table = new PdfPTable (3); float[] width = new float[] { 2.5F, 1.5F, 3.0F }; line6table.SetWidths(width);[code]....
I am generating a pdf file in asp.net c# using itextsharp. i am not able to draw a horizontal line/verticle line/dotted line.
i tried to draw a line using the following code,i am getting no errors but the line is also not getting displayed in the pdf file
PdfContentByte cb = wri.DirectContent; cb.SetLineWidth(2.0f); // Make a bit thicker than 1.0 default cb.MoveTo(20, pdfDocument.Top - 40f); cb.LineTo(400, pdfDocument.Top - 40f); cb.Stroke();
What is the problem in the code.Is it because of the position of x y co-ordinates? I had used rough points to know approximate position in pdf,but the line never apears in the pdf file.
The output i am looking out for is as shown in image below.
I wanted to get the page number in each page of the pdf generated using iTextSharp 5.0.2.0.
right now part of the code is
[Code]....
But when i do this , it is showing the page number but the problem is it is showing same page number in all the pages. like "1" in all the pages. how to get the page number for the pdf file using iTextSharp version 5.0.2.0 ?
I tried to export a grid view to pdf using iTextSharp. When i build the program it does not leave me any exception.But when i tried to run the program and click on "Export to PDF" button, it leaves me with an following exception saying
"Could not load file or assembly 'itextsharp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"