Hi Giorgio,
Thanks for your inquiry. Please note that Aspose.Words for Android is a class library and with it you can programmatically generate, modify, convert and render word processing documents. So, it does not offer any UI or control for performing these document processing tasks. However, if you’re intended to just preview your Word/Html document in your android application, we can offer you a simple way that will help you in achieving what you are looking for.
- Load your Word document into Aspose.Words for Android
- Generate images against each page in Word document and then view them in some android control.
Please see the following code that uses standard ImageView widget to show Aspose.Words generated images:
try
{
String licString = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Aspose.Words.Android.lic";
String inputPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/input.html";
String outputPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/";
com.aspose.words.License lic = new com.aspose.words.License();
lic.setLicense(licString, this);
com.aspose.words.Document doc = new com.aspose.words.Document(inputPath);
com.aspose.words.ImageSaveOptions options = new com.aspose.words.ImageSaveOptions(SaveFormat.PNG);
options.setPageCount(1);
for (int i = 0; i < doc.getPageCount(); i++)
{
options.setPageIndex(i);
doc.save(outputPath + "out_" + i + ".png", options);
}
Bitmap bm = BitmapFactory.decodeFile(outputPath + "out_1.png");
ImageView img = (ImageView)findViewById(R.id.imageView1);
img.setImageBitmap(bm);
}
catch (Exception e)
{
e.printStackTrace();
}
Hope, this helps.