I am using aspose components for generating pdf file from asp.net page’s file stream.
I am trying to generate multiple payslip with japanese contents in the single pdf file.
The problem is i am able to generate the pdf file using below code snippet but the first payslip’s content comes without japanese content(hidden) but the subsequent payslip comes with japanese contents in the final output pdf file.
I am attaching output file for your reference and the below is the code for it.
Please do needful thing as soon as possible.
// add the section to PDF document sections collection
Aspose.Pdf.Generator.Section sect = pdf.Sections.Add();
var strWriter = new StringWriter();
byte[] data = AECrypt.EncryptWithSymmetricAid(rowNo, PublicKey);
var navistring = Convert.ToBase64String(data);
Server.Execute(string.Format(“~/pub/PDFGenerator.aspx?id={0}”, navistring), strWriter);
// Create text paragraphs containing HTML text
Aspose.Pdf.Generator.Text txtContent = new Aspose.Pdf.Generator.Text(strWriter.ToString());
// enable the property to display HTML contents within their own formatting
txtContent.IsHtmlTagSupported = true;
txtContent.IsFirstParagraph = true;
txtContent.IsFitToPage = true;
txtContent.UseTextInfoStyle = true;
txtContent.TextInfo.IsUnicode = true;
txtContent.TextInfo.FontName = “Arial Unicode MS”;
txtContent.TextInfo.FontEncoding = “utf-8”;
txtContent.TextInfo.IsUnicode = true;
txtContent.TextInfo.TruetypeFontFileName = “Arial Unicode MS”;
sect.PageInfo.PageWidth = Aspose.Pdf.Generator.PageSize.A4Height;
sect.PageInfo.PageHeight = Aspose.Pdf.Generator.PageSize.A4Width;
//Instantiate the MarginInfo instance
Aspose.Pdf.Generator.MarginInfo marginInfo = new Aspose.Pdf.Generator.MarginInfo();
marginInfo.Top = 42;
marginInfo.Bottom = 42;
marginInfo.Left = 40;
marginInfo.Right = 40;
// Assign the marginInfo instance to Margin property of section.PageInfo
sect.PageInfo.Margin = marginInfo;
// Add the text paragraphs containing HTML text to the section
sect.Paragraphs.Add(txtContent);
sect.IsNewPage = true;