I am not very experienced in Java and I am having trouble converting a ByteArrayInputStream
object to a FileInputStream
object.
Is there any way to do that ?
I wrote code that takes a file URL and pass it to this function renderer.setDocument(url);
Here is my code:
String url = new File(File_To_Convert).toURI().toURL().toString();
String HTML_TO_PDF = "C:/Taha/SmartPlannerNew/ConvertedFile.pdf";
ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(url);
but now I don't want to write anything on the hard disk so I exchanged the file with a ByteArrayInputStream
that contains my text now , and I want to pass this to ITextRenderer instead of passing the File URL.
Is there any way to do that?