Dear Team,
I am using PDFTron in .net core web application. I am getting an error at PDFNet.Initialize();
The error message is "Unable to load DLL ‘PDFNetC’ or one of its dependencies: The specified module could not be found."
I have installed the dll from Nuget Manager bu using PDFTron.NETCore.Windows.x64.
below is my code.
public IActionResult SplitFilesByPage(string sInFileName, string sSplitFolderName)
{
List lReturn = new List();
try
{
string sSplitFoldersPath = _iconfiguration.GetSection(“fileLocations”).GetSection(“SplitFoldersPath”).Value;
string sScannedPDFPath = _iconfiguration.GetSection(“fileLocations”).GetSection(“ScannedFilesPath”).Value;
string sSplitFoldersWorkFolder = _iconfiguration.GetSection(“fileLocations”).GetSection(“SplitFoldersWorkFolder”).Value;
sInFileName = sInFileName.Trim();
sSplitFolderName = sSplitFolderName.Trim();
cPDF oPDF = new cPDF();
List lFiles = oPDF.SplitPDFByPage(sScannedPDFPath + sInFileName, sSplitFoldersPath, sSplitFolderName, true);
int iPage = 0;
foreach (var sFile in lFiles)
{
iPage++;
cSplitFilesReturn oFile = new cSplitFilesReturn();
oFile.FileName = sSplitFoldersWorkFolder + “/” + sSplitFolderName + “/” + sFile;
oFile.PageNo = iPage;
lReturn.Add(oFile);
}
return this.Ok(lReturn);
}
catch (Exception EX)
{
}
}
public class cPDF
{
public static PDFNetLoader Loader { get; private set; }
static cPDF()
{
Loader = PDFNetLoader.Instance();
PDFNet.Initialize();
}
public List SplitPDFByPage(string sPDFPath, string sOutputPath, string sSplitFolder, bool bDeleteFilesBeforeSplit = true)
{
}
}