I found a Docx that saved as PNG via Document.SaveAs gives a bad result: all words seems in bold. If I convert same docx, in pdf conversion is fine.
Attached docx, png and pdf.
we did many tests and found out that the issue is not related specifically to DOCX, but to Verdana Font.
If we create a document with Verdana Font and then we use Aspose.Words.Java via NetBeans saving as PNG, the document is rendered correctly and all the four Verdana.ttf are correctly retrieved from dir C:\Windows\Font (see SShot-NetBeans.PNG from ProcessExplorer in attached zip). If instead we use our program always loading Aspose.Words.Java to save same document (on same PC) as PNG, the image created miss font Verdana Regular but has the other 3 (see SShot-DesktopFonts.PNG from ProcessExplorer in attached zip).
Do you know why Aspose in this case is not able to find Verdana Regular font? In both case seems it reaches correctly directory C:\Windows\Font, but in second case seems it doesn’t look for the Regular one.
Thank you for support
renato.mauro:If instead we use our program always loading Aspose.Words.Java to save same document (on same PC) as PNG, the image created miss font Verdana Regular but has the other 3 (see SShot-DesktopFonts.PNG from ProcessExplorer in attached zip).
we already implemented use of TrueTypeFont, their localization is reached but no warning for the problematic font is given back from Aspose.
We also tried the newAspose.Words for Java 15.10.0, but the issue is still there.
Attached you can see the visualization we do with our code via Aspose of a document without Verdana that is working fine but gives back warnings on use of table (DocWithWarning.PNG).
And the visualization of the problematic document with Verdana font that doesn’t issue any warning (DocVerdanaWithoutWarning.PNG).
A detail I missed to give is that our program is written in C++ and use AsposeWords.Java through JNI. Since it consist of some layers it will take me a while to produce you a code sample.
I will do it ASAP.
- Please embed the fonts inside your input document and share it
- Please create a standalone Java application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.
us we’ll start our investigation into your issue.
we can provide a sample C++ that calls Aspose.Words.Java via JNI. Attached you find: the input document and the .cpp that can be compiled ( it use only aspose-words-15.10.0-jdk16.jar).
We have compiled and reproduced the issue through it.
We run on a Windows 7 machine 64 bit, but we compiled everything at 32 bit using jre1.8.0_65 (32 bit).
The Verdana font is a system windows font, so there should be no need to embed it.
Thank you for support.
just tried with latest version 15.11.0 but the issue is still there.
I could not give you the PngSaveOption because the last test we send you, does directly a Save without SaveOptions (Aspose documentation/com/aspose/words/Document.html#save(java.lang.String)), passing directly the filename with extension.
We only open the input file (TestDocx.docx) and save it as Png (TestDocxConverted.png). We did this in the C++ we attached previously (main.zip) that uses Aspose.Java via JNI. In the output PNG the Verdana Normal is not present and it is substituted by Verdana Bold.
Thank you for support.
Thanks for your help to reproduce this issue.
The OS is Windows 7 64 bit.
The example attached in the previous post is a pure jni file (thus C/C++), so no JDK is needed; it has been built with Visual Studio 2008 9.0.30729.1 SP fully up-to-date and then run with JRE 1.8.0_66.
Anyway, in other cases, to build some Java code, the JDK is 1.8.0_66 with target 1.6, both on Windows 7 64 bit and SLES 9 and 11 32 bit.
Document doc = new Document(MyDir + “TestDocx.docx”);<o:p></o:p>
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
doc.save(MyDir + "Windows 7 - Out.png", options);
attached the result you required using Aspose.Words for Java 15.11.0 and ImageSaveOptions.
Main.cpp is our sample test updated with ImageSaveOption and TestDocxConverted.png is the output it produces (still not working fine).
TestDocxConvertedFromJava-Windows7.png is the output produced by the NetBeans/Java environment using the Java snippet you provided, that is working fine.
I confirm that in our complete C++ application we have already implemented successfully
IWarningCallback (for some other samples we receive warnings from Aspose), but in this specific case Aspose is not raising any warnings.
Thanks once more.
of course attached the Visual Studio 2008 solution, with project and c++ file.
We use it with Studio 2008 9.0.30729.1 SP and run with JRE 1.8.0_65 and aspose-words-15.11.0-jdk16.jar.
Thanks for your help.
- we still reproduce the problem on Windows 7 64 bit, calling Aspose-Word-Java 15.11.0 from a C++ JNI program, either running a 32 bit or a 64 bit process, building with VS2008; this happen on every machine we tested;
- you reproduced the same issue only on Windows 8 and have logged this problem in your issue tracking system as WORDSNET-12788.
Could you please confirm that WORDSNET-12788 is still pending?
Do you have any suggestion or request to make us help you investigate further (VNC session, code samples, etc.)?
Thanks again and regards,