---
title: "Generate PDF report on Android | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/generating-pdfs/generating-pdf-reports/"
md_url: "https://www.nutrient.io/guides/android/generating-pdfs/generating-pdf-reports.md"
last_updated: "2026-06-08T17:11:05.433Z"
description: "Create professional PDF reports on Android using Nutrient SDK. Utilize templates, add text and images, and customize your documents offline for business intelligence."
---

# Generate PDF reports on Android

With Nutrient, you can use templates to create a PDF report on a mobile device and without an internet connection. This is useful in business intelligence and can potentially amend applications such as Crystal Reports or SQL Server Reporting Services.

## Generating PDF documents

With a combination of features like [Document Editor](https://www.nutrient.io/guides/android/features/document-editor.md#programmatic-access) and annotations, Nutrient can create professional reports based on a template and include custom cover and final pages. See the `GenerateReportExample.java` example from the Catalog for more information.

## Adding text and images

You can add text with free text annotations and images using stamp annotations, like so:

### KOTLIN

```kotlin

// Create a free text annotation.
val freeTextAnnotation = FreeTextAnnotation(
	0,
	RectF(228f, 1024f, 828f, 964f),
	"Some Annotations"
)
freeTextAnnotation.textSize = 40f

// Add the free text annotation to the document.
document.annotationProvider.addAnnotationToPage(titleFreeTextAnnotation)

 // Create an image stamp annotation.
val image = BitmapFactory.decodeStream(context.assets.open("images/android.png"))

val imageStampAnnotation = StampAnnotation(
	0,
	RectF(60f, 400f, (60 + image.width / 4).toFloat(), (400 - image.height / 4).toFloat()),
	image
)

// Add the image stamp annotation to the document.
document.annotationProvider.addAnnotationToPage(imageStampAnnotation)

```

### JAVA

```java

// Create a free text annotation.
FreeTextAnnotation freeTextAnnotation = new FreeTextAnnotation(
	0,
    new RectF(228, 1024, 828, 964),
    "Some Annotations"
);
freeTextAnnotation.setTextSize(40);

// Add the free text annotation to the document.
document.getAnnotationProvider().addAnnotationToPage(freeTextAnnotation);

// Create an image stamp annotation.
Bitmap image = BitmapFactory.decodeStream(context.getAssets().open("images/android.png"));

StampAnnotation imageStampAnnotation = new StampAnnotation(
	0,
	new RectF(60, 400, 60 + image.getWidth() / 4, 400 - image.getHeight() / 4),
	image
);

// Add the image stamp annotation to the document.
document.getAnnotationProvider().addAnnotationToPage(imageStampAnnotation);

```

## Adding PDF pages/content into existing PDF pages

Stamp annotations allow you to embed and freely place/scale PDF pages _into_ other PDF pages, like so:

### KOTLIN

```kotlin

// Create the vector stamp annotation.
val vectorStampAnnotation = StampAnnotation(
	0,
	RectF(50f, 724f, 250f, 524f),
	"Stamp with custom AP stream"
)
// Set the PDF from assets containing the vector logo as the annotation's appearance stream generator.
vectorStampAnnotation.appearanceStreamGenerator = AssetAppearanceStreamGenerator("images/PSPDFKit_Logo.pdf")

// Add the vector stamp annotation to the document.
document.annotationProvider.addAnnotationToPage(vectorStampAnnotation)

```

### JAVA

```java

// Create the vector stamp annotation.
StampAnnotation vectorStampAnnotation = new StampAnnotation(
	0,
	new RectF(50, 724, 250, 524),
	"Stamp with custom AP stream"
);
// Set the PDF from assets containing the vector logo as the annotation's appearance stream generator.
vectorStamp.setAppearanceStreamGenerator(new AssetAppearanceStreamGenerator("images/PSPDFKit_Logo.pdf"));

// Add the vector stamp annotation to the document.
document.getAnnotationProvider().addAnnotationToPage(vectorStampAnnotation);

```

Refer to the [appearance streams](https://www.nutrient.io/guides/android/annotations/appearance-streams.md) guide for details.

## Adding form elements

Nutrient allows you to add, remove, and modify interactive form elements to allow things like user input or requesting a signature. These elements include text input, radio buttons, and checkboxes:

### KOTLIN

```kotlin

// Create the configuration for a new radio button.
val radioButtonFormConfiguration = RadioButtonFormConfiguration.Builder(
	0,
	RectF(30f, 500f, 60f, 470f)
).select().build()

// Add the radio button to a document.
val radioButtonFormField = document.formProvider.addFormElementToPage(
		"RadioButton",
		radioButtonFormConfiguration
    ) as RadioButtonFormField

```

### JAVA

```java

// Create the configuration for a new radio button.
RadioButtonFormConfiguration radioButtonFormConfiguration = new RadioButtonFormConfiguration.Builder(
	0,
    new RectF(30, 500, 60, 470)
).select().build();

// Add the radio button to a document.
RadioButtonFormField radioButtonFormField = (RadioButtonFormField) document.getFormProvider().addFormElementToPage(
		"RadioButton",
		radioButtonFormConfiguration
	);

```

Refer to the [form creation](https://www.nutrient.io/guides/android/forms/form-creation.md) guide for details.

## Flatten annotations

You can flatten annotations to prevent users from modifying them. Here’s how to flatten all annotation types except for link annotations:

### KOTLIN

```kotlin

val task: PdfProcessorTask =...

// We flatten all annotations.
task.changeAllAnnotations(PdfProcessorTask.AnnotationProcessingMode.FLATTEN)
// And then explicitly keep link annotations.
task.changeAnnotationsOfType(AnnotationType.LINK, PdfProcessorTask.AnnotationProcessingMode.KEEP)

```

### JAVA

```java

PdfProcessorTask task =...

// We flatten all annotations.
task.changeAllAnnotations(PdfProcessorTask.AnnotationProcessingMode.FLATTEN);
// And then explicitly keep link annotations.
task.changeAnnotationsOfType(AnnotationType.LINK, PdfProcessorTask.AnnotationProcessingMode.KEEP);

```

Refer to the [document processing](https://www.nutrient.io/guides/android/features/document-processing.md) guide for more details.

## Securing your PDF document

Nutrient allows you to secure a document against being opened by adding a password:

### KOTLIN

```kotlin

val task: PdfProcessorTask =...
val outputFile: File =...

// Only allow opening by users who know the password.
val password = "password"
val saveOptions = DocumentSaveOptions(
	password,
	EnumSet.of(DocumentPermissions.PRINTING),
	false,
	null
)

// Create the resulting document.
PdfProcessor.processDocument(task, outputFile, saveOptions)

```

### JAVA

```java

PdfProcessorTask task =...
File outputFile =...

// Only allow opening by users who know the password.
final String password = "password";
final DocumentSaveOptions saveOptions = new DocumentSaveOptions(
	password,
	EnumSet.of(DocumentPermissions.PRINTING),
	false,
	null
);

// Create the resulting document.
PdfProcessor.processDocument(task, outputFile, saveOptions);

```

Refer to the [creating a password-protected document](https://www.nutrient.io/guides/android/features/document-processing.md?#protecting-a-document-with-a-password) guide for details.
---

## Related pages

- [Generate PDFs programmatically on Android](/guides/android/pdf-generation/programmatically.md)
- [PDF generation library for Android](/guides/android/pdf-generation.md)
- [Generate PDFs from HTML on Android](/guides/android/pdf-generation/from-html.md)
- [Generate PDFs from a template on Android](/guides/android/pdf-generation/from-template.md)
- [Generate blank PDFs on Android](/guides/android/features/document-creation.md)
- [Effortlessly generate PDF thumbnails on Android](/guides/android/pdf-generation/thumbnail-preview.md)
- [Effortlessly generate PDFs from images on Android](/guides/android/pdf-generation/from-images.md)

