Issues converting MS Word documents into PDF

Hello,



We are currently using Aspose.Words.jar to convert MS Word documents into PDF on Mac platform, and we encountered for certain kinds of documents. It seems like the software has trouble to convert documents that are larger than 4MB or documents that have more than 200 pages.



We are using to following code to do the conversion:

=======

ByteArrayOutputStream dstStream = new ByteArrayOutputStream();

Document doc = new Document(path);

doc.save(dstStream, SaveFormat.PDF);

=======



Did we do something wrong? Is this a limitation of Aspose.Words.jar?



Thank you very much for your help.





Hi,


Thanks for your inquiry. Please upgrade to latest version of Aspose.Words i.e. 13.3.0 and let us know how does it go on your side? You can download it from the following link:

In case the problem still remains, could you please attach your input/output documents (.doc/.pdf files) here for testing? I will investigate the issue on my side and provide you more information.

Best regards,

Hello Awais,

Thanks for your support.

I downloaded the latest 13.4.0 from the link you provided, but I have trouble to test it.

We have a license for the original jar file (not sure which version though). But the license we have doesn't seem to work with the latest 13.4.0 Aspose.Words.jdk16.jar (renamed to Aspose.Words.jar). The setLicense call throws an exception "Cannot find license 'Aspose.Total.Java.lic'". The license file is in the same folder as the jar file, and it works fine with the original jar file. Does it mean the license we got is tied to the version we got?

We ignore the exception, and go ahead to convert the problematic file we want to test. But then Aspose is running in evaluation mode without a valid license. It doesn't convert the whole document (519 pages), just the first 15 pages. The last page has a line "This document was truncated here because it was created using Aspose.Words in Evaluation Mode."

In summary, the original Words.jdk.jar doesn't generate any output for this problematic file. The lastest one converts the first 15 pages in evaluation mode. So we don't know if the latest one can hanlde the whole file or not.

Just in case you want to look at the problematic document, it is "CSharp Language Specification.doc, version 3.0" we download from the web.

Please advice the next step.

Thanks,

Yongjian

Hi Yongjian,

Thanks for your inquiry. Please post your license file via mail to us. We will investigate the issue on our end and provide you more information. In order to post your license file to us please follow the instructions provided in the following link:

https://forum.aspose.com/t/how-to-send-license-file-to-support-team/225542

Secondly, the content is missing because you’re using Aspose.Words in evaluation mode and your document is truncated at the end. Please note that there is an evaluation limitation of maximum number of paragraphs in the document. Please read the following article for more details:

Best regards,

Hi Yongjian,
Yongjian:
We have a license for the original jar file (not sure which version though). But the license we have doesn't seem to work with the latest 13.4.0 Aspose.Words.jdk16.jar (renamed to Aspose.Words.jar). The setLicense call throws an exception "Cannot find license 'Aspose.Total.Java.lic'". The license file is in the same folder as the jar file, and it works fine with the
Thanks for sending your license via email to me. Your license is a valid license; however, while using the latest version of Aspose.Words for Java i.e. 13.4.0, I managed to reproduce this exception on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSJAVA-721. Your request has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

As a workaround, please load the license from this file by explicitly specifying the complete path in setLicense method as described here:
http://www.aspose.com/docs/display/wordsjava/Applying+a+License

Please let me know if I can be of any further assistance.

Best regards,

Hello Awais,

Thanks for your information.

By using the explicity file path in setLicense, our license works with the latest Aspose.Words.jar.

And I have two questions about the aspose.slides.jar.

1) Does it support PPTX format? The latest jar throws an exception "UnsupportedFormatException: The file is ZIP archive. It can be Microsoft PowerPoint 2007 PPTX presention". What jar do we need to support PPTX format?

2) Does it support CJK fonts? We test a PPT file with Chinese characters, and only boxes show up in the resulted PDF file.

Thanks,

Yongjian

Hi Yongjian,


Thanks for your inquiry. As your query is related to Aspose.Slides, I am moving your thread to Aspose.Slides forum where you will be guided appropriately.

Best regards,

Hi Yongjian,

I have observed the both issues shared by you and like to share that you need to use PresentationEx class in order to access the PPTX presentations. Please visit this documentation link for your convenience.

For your second inquiry related to rendering of CJK fonts, I request you to please provide sample presentation, generated output and source fonts used. I will investigate the issue further on my end to help you out.

Many Thanks,

Hello,



Here is one of the document used to test the conversion.



This PPT was converted into a PDF using aspose.slides.jar, and all the Chinese characters show up as boxes in the resulted PDF, which is attached here as newPPT.pdf.



Thanks,



Yongjian

Hi Yongjian,


I have worked with the presentation file shared using Aspose.Slides for Java 7.3.0 on my end in Windows 7 x64 installed with JDK 1.6_35. I have not been able to observe the issue by using following sample code. Please try using the specified product version on your end and share the complete environment details with us if there is still an issue.

Presentation present = new Presentation(path2+“P020080410300148592135.ppt”);
present.save(path2+“P020080410300148592135.pdf”, SaveFormat.Pdf);

Many Thanks,

Hello,

I downloaded aspose.slides.jar version 7.3.0, and made necessary changes to make it work (such as using com.aspose.slides.SaveFormat.Pdf instead of com.aspose.slides.export.SaveFormat.PDF...). The result is still the same. The output PDF contains only boxes.

I used a MacBook Pro running MacOSX 10.8.2, and jdk 1.6.0_37.

The resulted PDF is viewed on the MacBookPro using Adobe Reader 10.1.3 and also on Win 7 using Acrobat XI. It doesn't seem like missing language packages of the Acrobat/Reader, because inside the resulted PDF, the BaseFont being used is "FAAAAH+TimesNewRomanPS-BoldMT", which is not a Chinese font.

We have three questions:

1) Did you try to open the PDF file we attached before using Acrobat or Reader? Do you see the Chinese characters or boxes?

2) According to the font being written into the resulted PDF file, it seems like it is an issue generating the PDF. Does Aspose depend on certain version of JDK, with language packages?

3) Is it possible to send us a copy of the resulted PDF file you generated?

Thanks,

Yongjian

Hi Yongjian,

I like to share that the block characters that you are getting may be due to missing fonts on your end. Can you please ensure that you have presentation used font available on your Mac Machine. Aspose.Slides also offers to load fonts from custom location as well. You can copy the fonts in a directory and can load the link to directory with fonts using Aspose.Slides as given below.

String[] _fontDir = new String[] {path+"\\windows\\"};
FontsLoader.loadExternalFonts(_fontDir);

Please ensure that used fonts are availble on your end and if there is still an issue then please share the feedback and I will add a ticket for this.

yongjian:

1) Did you try to open the PDF file we attached before using Acrobat or Reader? Do you see the Chinese characters or boxes?

I opened the PDF file shared by you and even the one generated on my end using Adobe Acrobat Reader 11. I have observed block codes in case of your PDF but observed no block codes for fonts in case of PDF generated on my end using Windows 7.

yongjian:

2) According to the font being written into the resulted PDF file, it seems like it is an issue generating the PDF. Does Aspose depend on certain version of JDK, with language packages?


The JDK version is not an issue. In my opinion the fonts used are missing on your end. For this, I suggest you to please try rendering to PDF in Windows environment as it worked on my end. If it works on your end as well then simply copy the fonts directory from Windows 7 inside Windows directory to Mac machine. Then use the following sample code in your application to load the fonts in Mac.


String[] _fontDir = new String[] {path+"\\windows\\"};
FontsLoader.loadExternalFonts(_fontDir);

Hopefully, it will work. If it does not work even after this then please share feedback with us.

yongjian:

3) Is it possible to send us a copy of the resulted PDF file you generated?


I have already shared the generated PDF on my end with you in my previous post here.

Many Thanks,

According to the PDF you generated, Aspose is using a Chinese font called Simsun. This font is not found in the MacOSX /Library/Fonts folder. So I copy the simsunb.ttf file from a Windows 7 machine, and install it to the Mac machine. But problem is not fixed by this. Also tried to use the code mentioned in your reply to load the font folder. Doesn’t help either.



Now the original PPT file shows up properly using Preview and MS PowerPoint on the same Mac machine. Does it mean the font is supported by the system?



Thanks,



Yongjian

Hi Yongjian,


Thank you for carrying further investigation on your end. I have created an issue with ID SLIDESJAVA-33890 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,
Hi Yongjian,

Thank you for being patient. We have a good news for you that is WORDSJAVA-721 has now been resolved and its fix will be included in the next release of Aspose.Words (13.5.0) which is planned to be released by the end of May 2013. We will inform you via this forum thread as soon as the new release of Aspose.Words is published.

Best regards,

The issues you have found earlier (filed as WORDSJAVA-721) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

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


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