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

Free Support Forum - aspose.com

Parsing glyph data of OpenType(CFF) font is not supported Error

I am attempting to save a .docx file to HTML, and I am receiving an error attempting to parse the font. For my specific use case, I don’t care about font information, so I am ok ignoring fonts. I have attached the doc that causes the error and below is some sample code:


val options = new HtmlSaveOptions(SaveFormat.HTML)
options.setImagesFolder(imageDir.getPath)
// Uses this directory in the HTML for the image locations, while saving them in the directory
// above. Saves the translation step.
options.setImagesFolderAlias("…/imgs")
options.setUseAntiAliasing(true)
options.setUseHighQualityRendering(true)
// Prevent scaling of images.
options.setScaleImageToShapeSize(false)
// Ensure the file names for images are sanitized.
options.setImageSavingCallback(FilenameSanitizingSavingCallback)
// Ensure external images are still linked.
options.setExportOriginalUrlForLinkedImages(true)

// Load the document.
val asposeDoc = new AsposeDocument(file.getAbsolutePath)

// Convert to HTML.
asposeDoc.save(htmlFile.getAbsolutePath, options)

Here is the stack trace:
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Parsing glyph data of OpenType(CFF) font is not supported.
at com.aspose.words.zzZRF.zzX(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZRF.zzY(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz3O.zz1z(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz3R.zz1R(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz3R.zz1O(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZ1U.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZ62.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZ61.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZ61.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzXL.zzwr(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzXL.zzY(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZEH.zzZF0(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZEH.zzU(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZDZ.zzx(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZ47.zzSl(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzBR.zzXJ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzBS.zzbg(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZRY.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Document.updatePageLayout(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Document.zzXL(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzEH.zzY(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.ShapeRenderer.(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.ShapeBase.getShapeRenderer(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZOP.zzp(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZOO.zzn(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZOT.visitShapeStart(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Shape.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.CompositeNode.acceptCore(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Shape.accept(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.CompositeNode.acceptCore(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Paragraph.accept(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.CompositeNode.acceptChildren(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.CompositeNode.acceptCore(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Body.accept(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz0Q.zzZM(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz0Q.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz0Q.zzZZo(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zz0Q.zzZZx(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.zzZWQ.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Document.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Document.zzZ(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
at com.aspose.words.Document.save(Unknown Source) ~[aspose-words-16.1.0.jar:16.1.0.0]
Hi Jeremy,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for Java 16.1.0 and have not found the shared issue. Please use Aspose.Words for Java 16.1.0.

If you still face problem, please share your environment detail e.g. Operating system, Jdk version (32 bit or 64 bit)? We will investigate the issue on our side and provide you more information. Please also share the code of ImageSavingCallback.

Thanks for the response. We are using version 16.1.0. This issue is specific to our deployed server system. I have no issues with this document when running locally on my OS X machine, only when it is deployed to our servers.


Server environment is a Docker container running Ubuntu:
Linux 3.13.0-65-generic #105-Ubuntu SMP Mon Sep 21 18:50:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


Here is the code for ImageSavingCallback (simply sanitizes filenames per requirements for our use case):

object FilenameSanitizingSavingCallback extends IImageSavingCallback {
/**
* Handle an image save callback. This will force the filename to be lowercase.
*
* @param imageSavingArgs Information about the image.
/
def imageSaving(imageSavingArgs: ImageSavingArgs): Unit = {
// Ensure file names are lowercase and do not contain invalid characters.
imageSavingArgs.setImageFileName(
imageSavingArgs.getImageFileName.toLowerCase.replaceAll("[^-a-z0-9_\/\.]", “”)
)
}
}

Thanks
Hi Jeremy,

Thanks for sharing the detail. We have tested the scenario at Ubuntu and have not found the shared issue. We have attached the output Html with this post for your kind reference. Please make sure that you are using the same document.

If you still face problem, please share here the steps which you are using for Docker container to reproduce this issue at our end. We will investigate the issue on our side and provide you more information.

I had a chance to dig deeper, and I discovered it was caused by certain font packages being missing within the Docker container. To solve I ran the following command inside the container:


sudo apt-get install fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-extra libfontconfig1
Hi Jeremy,

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.