Under Linux system, the converted style is incorrect;Normal display under Windows system
NetCore 6.0
财富类-标品简化流程业务审批通知书模板——XXX项目 (3).docx (25.2 KB)
image.png (29.4 KB)
Code Example:
string targetName = DateTime.Now.Ticks + “.” + targetFormat;
string targetPath = Path.Combine(Path.GetTempPath(), targetName);
using (Converter converter = new Converter(docInfo.DocUri))
{
if (targetFormat.ToLower() == "pdf")
{
var options = new PdfConvertOptions();
converter.Convert(targetPath, options);
}
else
{
var options = new WebConvertOptions();
converter.Convert(targetPath, options);
}
}
1 Like
@zuoqingbo
Please share following details and we’ll investigate this issue:
- Conversion API version that you are using
- Linux version and flavor
- Resultant file that you get on Linux
Conversion API version : 24.6.0
PackageReference Include=“GroupDocs.Conversion.CrossPlatform” Version=“24.6.0”
@zuoqingbo
Thanks for providing the details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CONVERSIONNET-7008
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@zuoqingbo
In Linux you need to provide a directory where the custom font is located.
Take a look at the following code:
// Define the source file path
const string source = "财富类-标品简化流程业务审批通知书模板——XXX项目 (3) (1).docx";
// Create a new ConverterSettings object and add the font directory
var settings = new ConverterSettings();
settings.FontDirectories.Add("./fonts/");
// Create a new Converter object using the source file and the settings
using (var converter = new Converter(source, () => settings))
{
// Create a new WebConvertOptions object
var options = new WebConvertOptions();
// Convert the source file to an HTML file named "converted.html"
converter.Convert("converted.html", options);
}
Take a look at the output.png (45.3 KB). Please download the font and output files.