we need to convert csv file to pdf.
There are french accent characters and chinese characters in csv file.
The output pdf is correct when csv is encoded in UTF-8.
But the output pdf is not correct when csv is encoded in other format.
I think I should set the decode format when I read the csv
Could you give the guide for using the function aspose.cells.Encoding.getEncoding(“ISO-8859-1”)?
Can I detect the encoding format of csv file?
So I can read the csv in appropriate format instead of hard coding the decode format.
Second issue, The pdf file can not show the right content when the application runs on Linux.
I think it is the problem of missing required font on Linux.
I want to user CellsHelper.setFontDirs(ArrayList) to set multiple font folders.
But I can not find any example for that.
My general question is where I can find the example code if I do not know to use certain function.
Hi,
Thank you very much for your reply.
I need more details about Encoding.getEncoding(String encodingFormat)
How many option we have for the parameter encodingFormat?
Could you give me a list?
And is it possible to get encoding format by any method of Aspose.cells when we load an csv file?
The CellsHelper.setFontDirs method accepts an ArrayList so you may specify many font directories using this approach.
Could you give me the sample code for CellsHelper.setFontDirs method?
I need similar sample codes like these following.
The following sample code that I found another post for Aspose.word
// Retrieve the array of environment-dependent font sources that are searched by default.
// For example this will contain a “Windows\Fonts” source on a Windows machines.
// We add this array to a new ArrayList to make adding or removing font entries much easier.
ArrayList fontSources = new ArrayList(Arrays.asList(FontSettings.getFontsSources()));
// Add a new folder source which will instruct Aspose.Words to search the following folder for fonts.
com.aspose.words.FolderFontSource folderFontSource = new com.aspose.words.FolderFontSource(fontPath, true);
// Add the custom folder which contains our fonts to the list of existing font sources.
fontSources.add(folderFontSource);
// Convert the Arraylist of source back into a primitive array of FontSource objects.
com.aspose.words.FontSourceBase[] updatedFontSources = (com.aspose.words.FontSourceBase[])fontSources.toArray(new com.aspose.words.FontSourceBase[fontSources.size()]);
// Apply the new set of font sources to use.
FontSettings.setFontsSources(updatedFontSources);
Also need to have the sample code to set multiple font folder for Aspose.Slides , Aspose.Pdf
billzhang:
The CellsHelper.setFontDirs method accepts an ArrayList so you may specify many font directories using this approach.
Could you give me the sample code for CellsHelper.setFontDirs method?
I need similar sample codes like these following.
The following sample code that I found another post for Aspose.word
// Retrieve the array of environment-dependent font sources that are searched by default.
// For example this will contain a "Windows\Fonts\" source on a Windows machines.
// We add this array to a new ArrayList to make adding or removing font entries much easier.
ArrayList fontSources = new ArrayList(Arrays.asList(FontSettings.getFontsSources()));
// Add a new folder source which will instruct Aspose.Words to search the following folder for fonts.
com.aspose.words.FolderFontSource folderFontSource = new com.aspose.words.FolderFontSource(fontPath, true);
// Add the custom folder which contains our fonts to the list of existing font sources.
fontSources.add(folderFontSource);
// Convert the Arraylist of source back into a primitive array of FontSource objects.
com.aspose.words.FontSourceBase[] updatedFontSources = (com.aspose.words.FontSourceBase[])fontSources.toArray(new com.aspose.words.FontSourceBase[fontSources.size()]);
// Apply the new set of font sources to use.
FontSettings.setFontsSources(updatedFontSources);
CellsHelper.setFontDir("D:/FontDir");
//Add multiple directories containing fonts of type TTC & TTF
ArrayList dirs = new ArrayList();
dirs.add("D:/FontDir1");
dirs.add("D:/FontDir2");
CellsHelper.setFontDirs(dirs);
billzhang:
Thank you very much for your reply.
I need more details about Encoding.getEncoding(String encodingFormat)
How many option we have for the parameter encodingFormat?
Could you give me a list?
billzhang:
And is it possible to get encoding format by any method of Aspose.cells when we load an csv file?
billzhang:
Also need to have the sample code to set multiple font folder for Aspose.Slides , Aspose.Pdf