TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Khushboo Kumari
NA
112
14.6k
hindi Font HTML content pdf conversion
Nov 8 2017 1:51 AM
i am not able to convert hindi font HTML content
will you please any one help me .Ihave used this code below
private
void
CreatePDFFromHTMLFile(
string
html,
string
FileName)
{
TextReader reader =
new
StringReader(html);
// step 1: creation of a document-object
Document document =
new
Document(PageSize.A4, 30, 30, 30, 30);
// step 2:
// we create a writer that listens to the document
// and directs a XML-stream to a file
PdfWriter writer = PdfWriter.GetInstance(document,
new
FileStream(FileName, FileMode.Create));
// step 3: we create a worker parse the document
HTMLWorker worker =
new
HTMLWorker(document);
// step 4: we open document and start the worker on the document
document.Open();
// step 4.1: register a unicode font and assign it an allias
FontFactory.Register(
"C:\\Windows\\Fonts\\ARIALUNI.TTF"
,
"arial unicode ms"
);
// step 4.2: create a style sheet and set the encoding to Identity-H
iTextSharp.text.html.simpleparser.StyleSheet ST =
new
iTextSharp.text.html.simpleparser.StyleSheet();
ST.LoadTagStyle(
"body"
,
"encoding"
,
"Identity-H"
);
// step 4.3: assign the style sheet to the html parser
worker.Style = ST;
worker.StartDocument();
// step 5: parse the html into the document
worker.Parse(reader);
// step 6: close the document and the worker
worker.EndDocument();
worker.Close();
document.Close();
}
Reply
Answers (
3
)
How to get new automatic div when second row of table got
Generate a valid querystring in MVC