Import assets in bulk and create respective pages in Episerver CMS
Recently I came across one of the requirement to import PDF documents from external drive and create respective publication pages in Episerver. I have divided this requirement into below tasks:
- Import all PDF's into Episerver in same structure as it is in external drive
- Create episerver page for each PDF in same structure
To start with I have created two properties in setting page 1. Reference folder in Asset under which all PDF's will get imported and 2. Container page under which all publication pages will get created.
After creating properties, I have created admin tool to Import PDF. Below is logic to add in import service.
I still have to extend this feature to copy content from PDF to Publication pages. I will be using iText7 library for extension. Below is sample code for reading PDF's.
I have used below article as inspiration!
This functionality is very useful while migration of data. We can also extend this feature for various types of documents like PDF, Doc etc.