cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read the content of media (pdf)

Former Member
0 Likes
561

Hi I have 2 document models, which contain a catalog unaware media model attached to it, (one for each model). catalog unaware media contains a pdf file. I need to read the contents of the pdfs from the 2 models and combine it into one and create a new catalog unaware media model to store the newly created pdf.

    InputStream in = mediaService.getStreamFromMedia(doc1.getMedia())     ----- is throwing null pointer exception
    doc1.getMedia()  -> returns CatalogUnawareMediaModel 

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

HI Ananya

PDFBox is an excellent API to read, write and merge PDF files. Below is a link to official documentation https://pdfbox.apache.org/

Former Member
0 Likes