Free Support Forum - aspose.com

Messy codes when convert word to pdf or tiff

pls see http://www.aspose.com/community/forums/permalink/448151/448151/showthread.aspx#448151

In Linux OS I’m using aspose.words v11.10 for java to convert word documents to tiff or pdf formats, the word contains Chinese and English words and numbers. But When convert it into pdf, messy code occured in the pdf document. and the number will flow over the chinese words, please see the attached files.


But the problems above didn’t occur in windows operation. Can any exports help me?


the codes is as follows:

public class TestWord {
public static void main(String[] args) throws Exception {
String input=“g:/wd/chinese.doc”;
String ouput=“g:/wd/output/”;
TestWord t=new TestWord();
t.execWd(input, ouput);
}
public void execWd(String word, String outfolder) throws Exception {
Document doc = new Document(word);

doc.save(outfolder + “result.pdf”);
doc.save(outfolder + “result.doc”);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);
options.setTiffCompression(TiffCompression.CCITT_4);
options.setResolution(300);
doc.save(outfolder + “resulst.tiff”, options);

int pgCount = doc.getPageCount();
// 将word每一页生成一个tiff文件
for (int i = 0; i < pgCount; i++) {
options.setPageIndex(i);
options.setPageCount(1);
doc.save(outfolder + i + “.tif”, options);
}

}

}

In Linux OS I’m using aspose.words v11.10 to convert word documents to tiff or pdf formats, the word contains Chinese and English words and numbers. But When convert it into pdf, messy code occured in the pdf document. and the number will flow over the chinese words, please see the attached files.


But the problems above didn’t occur in windows operation. Can any export help me?


the codes is as follows:

public class TestWord {
public static void main(String[] args) throws Exception {
String input=“g:/wd/chinese.doc”;
String ouput=“g:/wd/output/”;
TestWord t=new TestWord();
t.execWd(input, ouput);
}
public void execWd(String word, String outfolder) throws Exception {
Document doc = new Document(word);

doc.save(outfolder + “result.pdf”);
doc.save(outfolder + “result.doc”);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.TIFF);
options.setTiffCompression(TiffCompression.CCITT_4);
options.setResolution(300);
doc.save(outfolder + “resulst.tiff”, options);

int pgCount = doc.getPageCount();
for (int i = 0; i < pgCount; i++) {
options.setPageIndex(i);
options.setPageCount(1);
doc.save(outfolder + i + “.tif”, options);
}

}

}

pls see https://forum.aspose.com/t/59180
Hi liu,

Thanks for your inquiry. I have already answered your query here in this post. Please follow that thread for further proceedings.