Hi,
the customer using aspose.word for Android 1.12 to convert word to png image in eclipse.the style and layout of character have changed in the result iamge.
please refer to the source file and result image in the attachment.
how to solve this issue?
Best Regard!
Eric
Hi Eric,
Please zip and attach following font files here for testing:
Also, please share simple source code to reproduce this issue on our end.
Best regards,
hi,
thank for your reply.please download the font and sample code in the below link.
http://www.componentcn.com/download/FontAndCode.zip
Best Regard!
Hi Eric,
Thanks for your inquiry. We have logged this problem as WORDSANDROID-195 in our issue tracking system. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for your inconvenience.
Best regards,
Hi Eric,
Thanks for being patient.
We have tested your issue by using latest version of Aspose.Words for Java.Android 17.3 and found everything working just fine. It looks like you are not specifying FontSettings. Please see the example below and attached screenshots:
public void testJiraA195() throws Exception
{
final File inFile = new File(Environment.getExternalStorageDirectory(), "A195/TestSource.doc");
final File outFile = new File(Environment.getExternalStorageDirectory(), "A195");
// Use LoadOptions to set up user’s fonts
LoadOptions loadOptions = new LoadOptions();
loadOptions.setFontSettings(createFontSettings(loadOptions)); // this method creates and configures FontSettings
Document doc = new Document(inFile.getPath(), loadOptions);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
options.setPageCount(1);
for (int i = 0; i <= doc.getPageCount() - 1; i++)
{
options.setResolution(350);
options.setPageIndex(i);
options.setUseHighQualityRendering(true);
doc.save(new File(outFile, "TestSourceOut_" + i + ".png").getPath(), options);
}
}
private static FontSettings createFontSettings(LoadOptions loadOptions)
{
FontSettings settings = loadOptions.getFontSettings();
if (settings == null)
settings = new FontSettings();
FontSourceBase[] sources = settings.getFontsSources();
FontSourceBase[] newSources = new FontSourceBase[sources.length + 2];
System.arraycopy(sources, 0, newSources, 0, sources.length);
newSources[newSources.length - 2] = new FolderFontSource(new File(Environment.getExternalStorageDirectory(), "A195/fonts/").getPath(), true, 1);
newSources[newSources.length - 1] = new FolderFontSource(new File(Environment.getExternalStorageDirectory(), "WinFonts").getPath(), true, 0); //
// At this point newSources contains all available Android fonts (new SystemFontSource(), plus fonts from user’s folder (/sdcard/A195/fonts/), plus Windows’ fonts (/sdcard/WinFonts/).
settings.setFontsSources(newSources);
return settings;
}
So there is no need to use Windows’ fonts in this case. Documents are looking almost the same without them.
Best regards,