We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Found misplaced character in the conversion to SVG format result

Hi Aspose team

We have a PowerPoint file and we convert it to SVG format with Aspose Slide 16.6.0 in Linux environment.
And We found that there is a character misplaced in the result SVG file.

Here is our code for conversion test:

Presentation pre = new Presentation(“ppt_pusheen.ppt”);

String dirName = UUID.randomUUID().toString();
File file = new File("" + dirName);
file.mkdirs();
for (int i = 0; i < pre.getSlides().size(); i++) {
System.out.println(“save to baos”);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pre.getSlides().get_Item(i).writeAsSvg(baos);

IOUtils.write(baos.toByteArray(), new FileOutputStream("" + dirName
+ “/” + (i + 1) + “.svg”));
}

Is there any fix or option to solve this problem?
I have uploaded the PowerPoint file, the conversion result, and comparison image.
Please check the attachment. Thank you :slight_smile:

Best,
Craig

Hi Craig,


I have worked with the presentation shared by you using Aspose.Slides for JAVA 16.7.0 and unable to reproduce the issue. I request to you please use Aspose.Slides for JAVA latest version on your end. If there is still an issue please share feedback with us.

Best Regards,

Hi Adnan.Ahmad


Thanks for your help.

I converted it again, and the problem still exists.
Please check the result in the attachment. Thank you.

Best,
Craig

Hi Craig,


I have observed your comments. A ticket with ID SLIDESJAVA-35617 has been added in our issue tracking system to resolve the issue. This thread has been associated with the ticket so that we share notification with you once issue will be fixed.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-35617) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Aspose team


This issue still exists in 16.8.0 on Linux environment
Please check the conversion result again, thanks

Hi Craig,

I have observed your comments. Actually, this problem occurs on Linux because Calibri and Times New Roman fonts are missing. Can you please use FontsLoader or install these fonts and then try again.

Many Thanks,

Hi Mudassir


We added some code to replace fonts when it is not available.
The misplaced characters problem is fix in the result.

We will do some QA test further more, and thanks for the information.

Hi Craig,

Thank you for sharing the feedback with us. Please feel free to share if there is any further issue in this regard.

Many Thanks,

Hi


I would like to share another problem we found in Linux environment.
Here is our code for conversion test:

public static void main(String[] args) throws Exception {

Presentation pre = new Presentation(
args[0]);

FontSubstRuleCollection fontRuleColl = new FontSubstRuleCollection();
for(final IFontData fontData :pre.getFontsManager().getFonts()){
fontRuleColl.add(new IFontSubstRule() {
@Override
public IFontData getSourceFont() {
return fontData;
}
@Override
public int getReplaceFontCondition() {
return FontSubstCondition.WhenInaccessible;
}
@Override
public IFontData getDestFont() {
return new FontData(“Noto Sans CJK TC Regular”);
}
});
}
pre.getFontsManager().replaceFont(fontRuleColl);


String dirName = UUID.randomUUID().toString();
File file = new File("" + dirName);
file.mkdirs();

for (int i = 0; i < pre.getSlides().size(); i++) {

pre.getSlides()
.get_Item(i)
.writeAsSvg(
new FileOutputStream(""
+ dirName + “/” + (i + 1) + “.svg”));

}
}

There some text in the result exceed edge after we replaced the fonts and then converted it in to SVG format.
I have uploaded a comparison image, the result, and the origin PowerPoint file

Please analyze this issue
Thanks for your help


Craig

Hi Craig,


I have observed your comments. A ticket with ID SLIDESJAVA-35687 has been added in our issue tracking system to resolve the issue. This thread has been associated with the ticket so that we share notification with you once issue will be fixed.

We are sorry for your inconvenience,

Hi Craig,


Our Product team is investigating issue in details. Can you please share following information so that we may further investigate issue.
  • jdk version
  • the list of installed fonts (fc-list command)
  • fonts configuration file (fonts.conf file)

Best Regards,

Hi Adnan.Ahmad


Here are the results of the commeads:

java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (rhel-2.6.6.1.el7_2-x86_64 u101-b00)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

fc-list
/usr/share/fonts/forread/TW-Sung-98_1.ttf: TW-Sung,全字庫正宋體:style=Regular
/usr/share/fonts/forread/TW-Kai-Ext-B-98_1.ttf: TW-Kai-Ext-B,全字庫正楷體 Ext-B:style=Regular
/usr/share/fonts/forread/wt011.ttf: HanWangHeiLight,王漢宗細黑體繁:style=Regular
/usr/share/X11/fonts/Type1/c0611bt_.pfb: Courier 10 Pitch:style=Bold Italic
/usr/share/X11/fonts/Type1/UTBI____.pfa: Utopia:style=Bold Italic
/usr/share/fonts/forread/timesbi.ttf: Times New Roman:style=Bold Italic,Negreta cursiva,tučné kurzíva,fed kursiv,Fett Kursiv,Έντονα Πλάγια,Negrita Cursiva,Lihavoitu Kursivoi,Gras Italique,Félkövér dőlt,Grassetto Corsivo,Vet Cursief,Halvfet Kursiv,Pogrubiona kursywa,Negrito Itálico,Полужирный Курсив,Tučná kurzíva,Fet Kursiv,Kalın İtalik,Krepko poševno,nghiêng đậm,Lodi etzana
/usr/share/X11/fonts/Type1/c0419bt_.pfb: Courier 10 Pitch:style=Regular
/usr/share/X11/fonts/Type1/c0648bt_.pfb: Bitstream Charter:style=Regular
/usr/share/fonts/forread/wt001.ttf: HanWangMingLight,王漢宗細明體繁:style=Regular
/usr/share/fonts/forread/times.ttf: Times New Roman:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,thường,Arrunta
/usr/share/fonts/forread/NotoSansCJKtc-Regular.otf: Noto Sans CJK TC,Noto Sans CJK TC Regular:style=Regular
/usr/share/fonts/opensymbol/opens___.ttf: OpenSymbol:style=Regular
/usr/share/fonts/forread/timesbd.ttf: Times New Roman:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiona,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia
/usr/share/X11/fonts/Type1/cursor.pfa: Cursor:style=Regular
/usr/share/X11/fonts/Type1/UTB_____.pfa: Utopia:style=Bold
/usr/share/X11/fonts/Type1/c0583bt_.pfb: Courier 10 Pitch:style=Bold
/usr/share/fonts/forread/timesi.ttf: Times New Roman:style=Italic,cursiva,kurzíva,kursiv,Πλάγια,Kursivoitu,Italique,Dőlt,Corsivo,Cursief,kursywa,Itálico,Курсив,İtalik,Poševno,nghiêng,Etzana
/usr/share/X11/fonts/Type1/UTI_____.pfa: Utopia:style=Italic
/usr/share/X11/fonts/Type1/c0582bt_.pfb: Courier 10 Pitch:style=Italic
/usr/share/fonts/forread/TW-Kai-Plus-98_1.ttf: TW-Kai-Plus,全字庫正楷體 Plus:style=Regular
/usr/share/fonts/forread/wt006.ttf: HanWangYenLight,王漢宗細圓體繁:style=Regular
/usr/share/fonts/forread/TW-Kai-98_1.ttf: TW-Kai,全字庫正楷體:style=Regular
/usr/share/X11/fonts/Type1/c0633bt_.pfb: Bitstream Charter:style=Bold Italic
/usr/share/X11/fonts/Type1/c0649bt_.pfb: Bitstream Charter:style=Italic
/usr/share/X11/fonts/Type1/c0632bt_.pfb: Bitstream Charter:style=Bold
/usr/share/X11/fonts/Type1/UTRG____.pfa: Utopia:style=Regular

fonts.conf will be in the attachment.

By the way, about the first problem of the beginning of this thread,

if we use another font for font-replacement,
and then convert it to SVG format, the issue still remains.

Here is our code for test:

public static void main(String[] args) throws Exception {
Presentation pre = new Presentation(
args[0]);
FontSubstRuleCollection fontRuleColl = new FontSubstRuleCollection();
for(final IFontData fontData :pre.getFontsManager().getFonts()){
fontRuleColl.add(new IFontSubstRule() {
@Override
public IFontData getSourceFont() {
return fontData;
}
@Override
public int getReplaceFontCondition() {
return FontSubstCondition.WhenInaccessible;
}
@Override
public IFontData getDestFont() {
return new FontData(“HanWangHeiLight”);
}
});
}
pre.getFontsManager().replaceFont(fontRuleColl);

String dirName = UUID.randomUUID().toString();
File file = new File("" + dirName);
file.mkdirs();
for (int i = 0; i < pre.getSlides().size(); i++) {

pre.getSlides()
.get_Item(i)
.writeAsSvg(
new FileOutputStream(""
+ dirName + “/” + (i + 1) + “.svg”));

}
}

The font used for font-replacement changed from “Noto Sans CJK TC Regular” to "HanWangHeiLight"


I have uploaded the result and the font, please analyze this issue again, thanks for your help.

Craig

Hi Craig,


I have observed your comments. I like to share that i have reopened the ticket. We will share feedback with you soon.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-35617) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as SLIDESJAVA-35687) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.