Hi,
Thanks for your reply.
Please find the sample text below:
中國哲學書電子化計劃
Sample html string:
company a limited license to use XXXX
Hi Awaisv,
I cen see discrepancy while converting Hebrew and Arabic text as well.
Please find the sample text below.
Chinese : 中國哲學書電子化計劃
Hebrew : אָנֹכִי מְצַוֶּה | אֶתְכֶם הַיּוֹם, לְאַהֲבָה אֶת יְיָ | אֱלֹֽהֵיכֶם, וּלְעָבְדוֹ
Arabic : جامعة الدول العربية هي
English: Sample Text
The output text in pdf is as below:
Chinese : ����������
Hebrew : ודבעלו ,םכיהלא | יי תא הבהאל ,םויה םכתא | הוצמ יכנא
Arabic : يه ةيبرعلا لودلا ةعماج
English: Sample Text
Please find the html string below while converting the text to pdf:
company a limited license to use XXXX Central - External
company a limited license to use XXXX Central - External
Hi,
Document();
DocumentBuilder docBuilder = new DocumentBuilder(doc);
docBuilder.InsertHtml(File.ReadAllText(MyDir+ "html2.htm", Encoding.UTF8));
doc.Save(MyDir + @“out2.pdf”);
Hi Awais,
Hi Awais,
Hi,
We have downloaded the dll of Aspose.Words(14.5.0.0) from the url you have share with me and ran our modified code.
It worked fine with Chinese, Arabic and Hebrew languages. However, still I can see issue with the following languages:
- Hindi
- Armenian
- Bengali
- Georgian
- Thai
Can you please guide me on this?
Please find the attached document with all our finding after using the latest version and modified code.
Hi,
Please find the console application with the input and output file attached herewith.
I am using the Aspose.Words 14.5.0.0 (Aspose.Words.dll under net3.5_ClientProfile_AuthenticodeSigned folder) for this console app.
Please find the code below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Aspose.Words;
namespace AsposeDemo
{
class Program
{
static void Main(string[] args)
{
ConvertToPDF();
}
public static void ConvertToPDF()
{
MemoryStream ms = null;
try
{
Console.WriteLine("Application Started..Please wait");
License setLicense = new License();
Document doc = new Document();
string exe_path = System.Reflection.Assembly.GetEntryAssembly().Location;
exe_path = exe_path.Substring(0, exe_path.LastIndexOf('\\') + 1);
DocumentBuilder docBuilder = new DocumentBuilder(doc);
docBuilder.InsertHtml(File.ReadAllText(exe_path + "pdfContent.htm", Encoding.UTF8));
ms = new MemoryStream();
doc.Save(ms, SaveFormat.Pdf);
ms.Position = 0;
Console.WriteLine("File getting created...");
using (FileStream file = new FileStream("Output.pdf", FileMode.Create, FileAccess.Write))
{
ms.WriteTo(file);
}
Console.WriteLine("File created successfully...");
Console.ReadLine();
}
catch (Exception ex)
{
}
}
}
}
Hi,
Hi,
Please find the server details below:
Windows Server(R) 2008 Standard
Version 6
.Net Framework 3.5
I have saved the file in docs format and same result occured.
However, as you have mentioned, I have checked the same code from my local desktop(Win 7 && .Net 4.0) and it worked from there.
So it seems , Aspose verion 14.5.0.0 works properly with particluar OS and .Net version?
Can you please guide me on the OS and .net version?
Saurabh
Hi Saurabh,
Thanks for your reply.
However, our requirement is to save the string in PDF format NOT is docx format.Please refer my earlier reply. So I would like to know the OS version and .Net framework version which are required to get Aspose 14.5.0.0 full funtionality to get the PDF with proper text/language.
Saurabh
Hi Saurabh,
Hi,
As I have already mentioned that I am facing this issue while I am ruuning the application from my dev (and production) servers with the following configurations.
Server Details:
Windows Server(R) 2008 Standard Version 6
.Net Framework 3.5
I would like to get the following information from your end:
- What is the minimum requirement of OS version to get the complete PDF using Aspose 14.5.0.0?
- What is the minimum requirement of .Net Framework version to get the complete PDF using Aspose 14.5.0.0?
Using the above input I would upgrade my dev (and production) servers accordingly.
Saurabh
Hi Saurabh,
Hi Awais,
Thanks for your reply. I did what you said but in vain. However I must insist that it is related to the Culture and not with the fonts. All other languages are successfully replicated in pdf except Thai, Bengali, Hindi, Armenian and Georgian. The output pdf was same as I had shared with you earlier.
Please advise.
Please find the updated console application:
============================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Aspose.Words;
using Aspose.Words.Saving;
namespace AsposeDemo
{
class Program
{
static void Main(string[] args)
{
ConvertToPDF();
}
public static void ConvertToPDF()
{
MemoryStream ms = null;
try
{
Console.WriteLine("Application Started..Please wait");
License setLicense = new License();
Document doc = new Document();
HandleDocumentWarnings callback = new HandleDocumentWarnings();
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.WarningCallback = callback;
string exe_path = System.Reflection.Assembly.GetEntryAssembly().Location;
exe_path = exe_path.Substring(0, exe_path.LastIndexOf('\\') + 1);
DocumentBuilder docBuilder = new DocumentBuilder(doc);
docBuilder.InsertHtml(File.ReadAllText(exe_path + "pdfContent.htm", Encoding.UTF8));
ms = new MemoryStream();
doc.Save(ms,saveOptions);
ms.Position = 0;
Console.WriteLine("File getting created...");
using (FileStream file = new FileStream("Output.pdf", FileMode.Create, FileAccess.Write))
{
ms.WriteTo(file);
}
Console.WriteLine("File created successfully...");
Console.ReadLine();
}
catch (Exception ex)
{
}
}
}
}
------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Words;
namespace AsposeDemo
{
class HandleDocumentWarnings : IWarningCallback
{
///
/// Our callback only needs to implement the "Warning" method. This method is called whenever there is a
/// potential issue during document procssing. The callback can be set to listen for warnings generated during document
/// load and/or document save.
///
public void Warning(WarningInfo info)
{
// We are only interested in fonts being substituted.
if (info.WarningType == WarningType.FontSubstitution)
{
Console.WriteLine("Font substitution: " + info.Description);
}
}
}
}
============