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
Prashant Verma
NA
77
2.4k
pdf is not showing correct hindi.
Feb 22 2019 12:17 AM
I am using itextsharp.dll hindi in pdf is not showing correctly.
Code
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.Buffer =
true
;
response.Charset =
""
;
response.Cache.SetCacheability(HttpCacheability.NoCache);
response.ContentType =
"application/octet-stream"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename=Service_History.pdf"
);
response.ContentEncoding = System.Text.Encoding.Unicode;
Document document =
new
Document();
PdfWriter.GetInstance(document, response.OutputStream);
document.Open();
using
(StringWriter sw =
new
StringWriter())
{
using
(HtmlTextWriter htw =
new
HtmlTextWriter(sw))
{
StringReader sr =
new
StringReader(sw.ToString());
iTextSharp.text.Document pdfDoc =
new
Document(PageSize.A4, 60f, 60f, 50f, 10f);
HTMLWorker htmlparser =
new
HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, response.OutputStream);
pdfDoc.Open();
// BaseFont bf = BaseFont.CreateFont(Environment.GetEnvironmentVariable("windir") + @"\fonts\Utsaah.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
// BaseFont bf = BaseFont.CreateFont(Environment.GetEnvironmentVariable("windir") + @"\fonts\Mangal.TTF", BaseFont.IDENTITY_H, true);
BaseFont bf = BaseFont.CreateFont(Environment.GetEnvironmentVariable(
"windir"
) + @
"\fonts\ARIALUNI.TTF"
, BaseFont.IDENTITY_H,
true
);
PdfPTable table =
new
PdfPTable(dt_excel.Columns.Count);
table.WidthPercentage = 100;
table.HorizontalAlignment = 1;
Reply
Answers (
1
)
Get Weekly Business dates for a given two dates range
Error please find the code