Skip to content Skip to sidebar Skip to footer

Itextg Causing Application Crash(android)

My objective is to superimpose contents of a pdf onto another PDF. this is the code that I have used: AssetManager assetManager = getAssets(); InputStream istr = null; Pdf

Solution 1:

I assume the exception occurs here:

istr =(InputStream) assetManager.open("Chemistry.pdf");

The exception

java.lang.ClassCastException: android.content.res.AssetManager$AssetInputStream cannot be cast to com.itextpdf.text.pdf.codec.Base64$InputStream

indicates that the InputStream in that code line is not the expected java.io variant.

Most likely you have an import like

import com.itextpdf.text.pdf.codec.Base64.InputStream

while you actually wanted

import java.io.InputStream

Post a Comment for "Itextg Causing Application Crash(android)"