Aspose.Words for Android via Java Limitations and API Differences
Contents
[
Hide
]
Limitations of Aspose.Words for Android via Java API compared to Aspose.Words for Java API
- *Document.print *methods are not available.
- Saving in TIFF and BMP formats is not supported, though SaveFormat.TIFF and SaveFormat.BMP are available in public Aspose.Words for Android via Java API, but UnsupportedOperationException is thrown when these save formats are used.
- Reading TIFF images is not supported.
- Signing ODT documents is not supported yet.
- Barcodes are not supported.
- Gradients along a curve are not supported
- Printing is not supported
Public API differences
- android.graphics.Bitmap is used instead of java.awt.image.BufferedImage;
- android.graphics.Canvas is used instead of java.awt.image.Graphics2D;
- android.graphics.RectF is used instead of java.awt.geom.Rectangle2D.Float;
- android.graphics.PointF is used instead of java.awt.geom.Point2D.Float;
- android.graphics.Rect is used instead of java.awt.Rectangle;
- android.graphics.Point is used instead of java.awt.Point.
See the following Public API methods:
- com.aspose.words.DocumentBuilder:
- insertImage(Bitmap)
- insertImage(Bitmap, double, double)
- insertImage(Bitmap, int, double, int, double, double, double, int)
- insertOleImage(Bitmap)
- insertOleObject(InputStream, String, boolean, Bitmap)
- insertOleObject(String, boolean, boolean, Bitmap)
- insertOleObject(String, String, boolean, boolean, Bitmap)
- com.aspose.words.IBarcodeGenerator:
- Bitmap getBarcodeImage(BarcodeParameters)
- Bitmap getOldBarcodeImage(BarcodeParameters)
- com.aspose.words.ImageData:
- setImage(Bitmap)
- Bitmap toImage()
- com.aspose.words.ImageFieldMergingArgs:
- Bitmap getImage()
- setImage(Bitmap)
- com.aspose.words.Document:
- android.graphics.PointF renderToScale(int, Canvas, float, float, float) throws Exception
- float renderToSize(int, Canvas, float, float, float, float) throws Exception
- com.aspose.words.LayoutEnumerator:
- android.graphics.RectF getRectangle() throws Exception
- com.aspose.words.NodeRendererBase:
- android.graphics.PointF getSizeInPoints()
- android.graphics.RectF getOpaqueBoundsInPoints()
- public android.graphics.PointF getSizeInPixels(float, float)
- android.graphics.Rect getBoundsInPixels(float, float)
- android.graphics.Rect getOpaqueBoundsInPixels(float, float)
- android.graphics.PointF renderToScale(Canvas, float, float, float)
- float renderToSize(Canvas, float, float, float, float)
- com.aspose.words.PageInfo:
- android.graphics.PointF getSizeInPixels(float, float)
- android.graphics.PointF getSizeInPoints()
- com.aspose.words.ShapeBase:
- android.graphics.RectF adjustWithEffects(android.graphics.RectF)
- android.graphics.RectF getBounds()
- android.graphics.RectF getBoundsInPoints()
- android.graphics.RectF getBoundsWithEffects()
- android.graphics.Point getCoordOrigin()
- android.graphics.PointF getCoordSize()
- android.graphics.PointF getSizeInPoints()
- android.graphics.PointF localToParent(android.graphics.PointF)
- setBounds(android.graphics.RectF)
- setCoordOrigin(android.graphics.Point)
- setCoordSize(android.graphics.PointF)
- com.aspose.words.ThumbnailGeneratingOptions:
- android.graphics.PointF getThumbnailSize()
- setThumbnailSize(android.graphics.PointF)
Aspose.Words for Android via Java additional requirements
In order to use metered licensing feature and load documents or images by http/ftp protocols users should add following permission to their applications <uses-permission android:name="android.permission.INTERNET” />
Public API Examples
public void testPublicAPI1() throws Exception
{
final String imagePath = "myImage.pmg";
Bitmap image = null;
try
{
image = BitmapFactory.decodeFile(imagePath);
DocumentBuilder builder = new DocumentBuilder();
builder.insertImage(image);
}
finally
{
if (image != null)
image.recycle();
}
}
public void testPublicAPI2() throws Exception
{
String gTestDocumentPath = "testDoc.docx";
String outFile = "out.png";
Document doc = new Document(gTestDocumentPath);
Bitmap image = null;
FileOutputStream fos = null;
try
{
image = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
Canvas gr = new Canvas(image);
gr.rotate(45);
doc.renderToSize(0, gr, 0, 0, image.getWidth(), image.getHeight());
fos = new FileOutputStream(outFile);
image.compress(Bitmap.CompressFormat.PNG, 100, fos);
}
finally
{
if (fos != null)
fos.close();
if (image != null)
image.recycle();
}
}