Hi
We are facing problem with Japanese character in unix environment but working fine with Windows. Generated XML file seems to be ok but not PDF File. Any idea how to fix this issue?
Our code:
public static byte[] convertXlsToPdf(byte[] doc) throws Exception {
try {
ByteArrayOutputStream xmlOutputStream = new ByteArrayOutputStream();
ByteArrayOutputStream pdfOutputStream = new ByteArrayOutputStream();
Workbook workbook = new Workbook();
workbook.open(new ByteArrayInputStream(doc));
workbook.save(xmlOutputStream, FileFormatType.ASPOSE_PDF);
Pdf pdf = new Pdf();
pdf = Pdf.bindXML(new ByteArrayInputStream(xmlOutputStream.toByteArray()));
pdf.save(pdfOutputStream);
return pdfOutputStream.toByteArray();
} catch (Exception e) {
throw new TitanException("titan.rendering.conversion.Excel2PDF.error", e);
}
}
Thanks
Sasanka
Hello Sasanka,
Can you please share the resource XLS file and the intermediate XML that you have generated over UNIX environment so that we can test the scenario at our end. We apologize for your inconvenience.
PS, I would really appreciate if you also share the information regarding versions of Aspose.Pdf and Aspose.Cells that you are using.
Hi
Please find the attached XML file. Generated PDF file had no Japanese character but blank space.
I don’t have corresponding Excel file. But I think Excel to XML conversion was okay as I can see Japanese character in XML file but not in PDF file.
Thanks
Sasanka
Hello Sasanka,
I've tested the scenario using Aspose.Pdf v4.0.0.0 and I am unable to reproduce the problem. In fact in my case the resultant PDF file is being generated correctly without any problem. The file is in attachment, please take a look.
I've used the following simple code to convert the XML file into PDF. Please try using the latest version of Aspose.Pdf and in case you still face any problem, please feel free to share.
[C#]
Pdf p = new Pdf();
p.BindXML(@"d:\pdftest\xls2pdf1243957761518.xml",null);
p.Save(@"d:\pdftest\xls2pdf1243957761518.pdf");
Hi
We still have this problem. Is there any way we can debug or see debug messages from Aspose library so that we can understand the problem? If we can print all the text of the report at the time of processing we can pin point the problem.
NOTE: We are using Java not C#
Thanks
Sasanka
Hi Aspose team
We are trying to covert XLS to PDF and XLS has Japanese characters in it. When I am converting this in the Windows environment, it is working fine but is not working when running in the UNIX environment. I think the main issue here is the font type/encoding. I’ve attached an intermediate XML file which was generated before producing the PDF file. If you check the XML file carefully it has the following font name [MS P ゴシック]
Is there any way to set True Type font [like set FontFile, encoding]? I can see 14 AFM files inside aspose.pdf.jar. Do you think we need more to make this work? I’ve also attached the generated PDF file for your ready reference.
Thanks
Sasanka
Is there any update on this? Can we not set this japanese font in UNIX environment?
Thanks
Sasanka
Hi,
As most of test cases are tested on Windows, we need more time to fix it on Unix machine.
Thank you for your patience.
Could you recommend a workaround for this problem? For example, if we could use a special font in our reports, and provide required font definitions in the classpath.
Any help or ideas how to go around this problem is greatly apprisiated .
Thank you.
Hello,
We have been working on this issue for a long time, but we still don’t find a solution as we don’t familiar with the Japanese Fonts on Unix platform. We try to use the truetype font file directly, but it doesn’t work at present. We need more time to resolve it.
Thank you for your patience.