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

Free Support Forum - aspose.com

Com.aspose.pdf.internal.p217.z338: Parsing of table 'GDEF' has failed while saving document

Dear Support,

I have this code example throws exception while saving attached pdf(having tables) to Output stream using DocSaveOptions.

I get exception com.aspose.pdf.internal.p217.z338: Parsing of table 'GDEF' has failed.

Testing environment

OS: cent os

App server: tomcat 7.0.59

JAVA : JDK7

Aspose pdf version : aspose.pdf-10.6.2.jar

Note : I tested this code example in with OS X Mavericks, this code is working without issue.


//Create DocSaveOptions object

com.aspose.pdf.DocSaveOptions saveOptions = new com.aspose.pdf.DocSaveOptions();

saveOptions.setFormat(SaveFormat.Doc);

//Set the recognition mode as Flow

saveOptions.setMode(com.aspose.pdf.DocSaveOptions.RecognitionMode.Flow);


//Set the Horizontal proximity as 2.5

saveOptions.setRelativeHorizontalProximity(2.5f);


//Enable the value to recognise bullets during conversion process

saveOptions.setRecognizeBullets(true);

document.save(baos, saveOptions);

Please check it and let me know this.

Hi there,


Thanks for your inquiry. We will test the scenario on Cent os and share our findings with you soon.

We are sorry for the inconvenience caused.

Best Regards,

Any update on this issue. As, we need this to be done ASAP

Hi Ganesh,


Thanks for your patience.

We are working on setting up the CentOS so that we can test the scenario in our environment. Please note that environment setup is taking time and as soon as we have some further updates, we will let you know.

Hi Ganesh,


Thanks for your patience. I have tested the scenario over Cent OS and unable to notice the reported exception. Can you please double check whether you have set font folder path according to your system settings before processing? I have set font folder path on my server as following. Please set font path as per your system font folder path and then proceed. Hopefully it will resolve the issue.

// Set font folder path
String path = “/usr/share/fonts/msttcorefonts/”;
// Adding a single font directory
// com.aspose.pdf.Document.addLocalFontPath(path);

// setting the user list for standard font directories
java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();
list.add(path);

Please feel free to contact us for any further assistance.

Best Regards,

Dear Support,

Do you mean Microsoft fonts path should be on fonts local paths while converting PDF to DOCS?

This log shows fonts path as
createMaskedDocument() set font paths are [/usr/openwin/lib/X11/fonts/TrueType/, /usr/local/share/fonts/, $home/.fonts/, /usr/X11R6/lib/X11/fonts/ttfonts/, ~/.fonts/, /usr/share/fonts/, /usr/share/X11/fonts/TTF/, /system/fonts/, /home/sas/.fonts/, /home/sas/dad/tmp/ganesh/TTF/]" “” ""

This was working perfectly with aspose-pdf-9.3.1-jdk16.jar version. For feature updates, I tried latest version and I got said issue.


Hi Ganesh,


Thanks for your feedback. Yes you are right, installed fonts should be present in system local fonts path.

Best Regards,
Dear Support,

Even though installed fonts is added as you mentioned earlier, still I am getting same error.

Previously This error is throwing while converting document from PDF to DOCX/DOC.

Now, I have attached PDF file, Even though I tried to same document in PDF file, Same error is thrown.

I guess exact cause is something else. please check this issue urgently, as it is dragging long back.

Hi Ganesh,


Thanks for sharing the resource file and sorry for the delayed response.

We are working on testing the scenario using recently shared file and will keep you posted with our findings.

FYI, server is running in cloud.

Hi Ganesh,


Thanks for your feedback. Please note you are getting issue because Aspose.Pdf is unable to find required fonts and it throws the subjected exception. I have tested again the scenario at my end on CentOs and unable to notice the issue.

Please download and try the latest Aspose.Pdf for Java release version 11.0.0, because we have fixed some fonts related issues of Linux in this version. Please also double check that required fonts that are used in the PDF document (ttf-mscorefonts) are installed and you have set the the path where these fonts are installed as suggested above.

However if the issue persist at your end then please share sample your complete environment details and the code, along with font path setting code.

We are sorry for the inconvenience caused.

Best Regards,

Dear support,

I am sharing code that throws exception as stated earlier using latest version of aspose.pdf.

I followed the solution as documentation listed in http://www.aspose.com/docs/display/cellsjava/How+to+Install+TrueType+Fonts+on+Linux.

Just copied all .ttf files in /home/*****/ganesh/msttcore/ path and trying to convert.

Linux #1 SMP Wed Jan 28 21:11:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

CentOS release 6.6 (Final)

Exception thrown is listed below

com.aspose.pdf.internal.p226.z338: Parsing of table ‘GDEF’ has failed.


code examples is listed as below:

public class MaskResumePDFUtil {

public static void setLocalMachineFontFolder(){

LOGGER.warning(“In getPdfSaveOptions() method getting Pdf save options”);

try{

java.util.List list=com.aspose.pdf.Document.getLocalFontPaths();

list.add("/usr/share/fonts/");//NO I18N

list.add("/usr/local/share/fonts/");//NO I18N

list.add("/usr/X11R6/lib/X11/fonts/");//NO I18N

list.add("/home/*****/ganesh/msttcore/");//NO I18N

}catch(Exception e){

LOGGER.warning(“Exception occured while getting Pdf saveoptions”);

}

}

public static void main(String args[]){

setLocalMachineFontFolder();

String path = "/home/*****/ganesh/testdocument.pdf";//NO I18N

String tpath = "/home/*****/ganesh/testdocument.doc";//NO I18N

document = new Document(path);

document.save(tpath,SaveFormat.Doc);

}

}



Hi Ganesh,


Thanks for the sharing additional information. I am looking into it and will update you soon.

Best Regards,

Hi Ganesh,


We are sorry for the inconvenience. I have again tested the scenario on CenOS but unable to replicate the issue, so logged a ticket PDFNEWJAVA-35552 in our issue tracking system for further investigation. We will keep you updated about the issue resolution progress within this forum thread.

Best Regards,

Hi Ganesh,


It seems your Method setLocalMachineFontFolder is incorrect. You has used only getter, but to apply
changes needs to set updated list using the method setLocalFontPaths. Please use latest version of Aspose.Pdf for Java 11.2.0 and change your font folder path code as following and share the results.

java.util.List
list=com.aspose.pdf.Document.getLocalFontPaths();<o:p></o:p>

list.add("/usr/share/fonts/");//NO I18N

list.add("/usr/local/share/fonts/");//NO I18N

list.add("/usr/X11R6/lib/X11/fonts/");//NO I18N

list.add("/home/*****/ganesh/msttcore/");//NO I18N

com.aspose.pdf.Document.setLocalFontPaths(list);


Best Regards,

Dear Support,



I tried as you said by setting local path of the font files. Still error is coming.



One small clarification , Is releases after version aspose-pdf-10.0.0-jdk16.jar, not back ward compatible? As, issue is not reproducible in this version.

Hi Ganesh,


Thanks for your feedback. I have shared your findings with the product team and will update you accordingly. Furthermore can you please confirm that you are have tested the scenario with Aspose.Pdf for Java 11.2.0?

We are sorry for the inconvenience.

Best Regards,

Dear Support,


As per suggestion I have tested with Aspose.Pdf for Java 11.2.0 version.

As pdf to doc conversion working perfectly in current version of aspose-pdf-10.0.0-jdk16.jar that I am using.

For formatting improvements, I tried to upgrade the version of aspose pdf. to any version after aspose-pdf-10.0.0-jdk16.jar, I am getting same error as said.

I have doubt that these is some backward compatibility issue has been introduced in recent releases, as there was no any font issue I faced ever running on CentOS servers.

Let me know ASAP, as feature is breaking with a flood of customer support.


Hi Ganesh,


Thanks for your feedback. We have shared your findings/concern with the product team and we will keep you updated about the issue resolution progress.

Thanks for your patience and cooperation.

Best Regards,

Dear Support,


Even after long time, there is no solution from you.
Now I am facing another issue which has been fixed in recent aspose pdf release as listed below.
  • PDFNEWJAVA-35323 Server hard disk is filled up quickly by TrueType font data temp files
Please look ASAP.