Product: apryse webviewer
Please give a brief summary of your issue:
unable to change the default fall back font in webviewer in springboot application
Please describe your issue and provide steps to reproduce it:
-
We are having an springboot application to convert pdf document to word
-
Unable to change the default fall back font in webviewer in springboot application using the fonts inside our application in resource folder and the resource folder path is fed to : PDFNet.addResourceSearchPath
-
PDFNet.addResourceSearchPath(“/usr/local/WebSphere/AppServer/customlib/apryse-webviewer/fonts”);
-
the fonts folder has
└── fonts/
├── arial.ttf
├── arialbd.ttf
├── ariali.ttf
└── arialbi.ttf -
All the needed permissions has been given.
-
By default the font fonts are changes to dejavu sans condensed and
Please provide a link to a minimal sample where the issue is reproducible:
byte[] fileBytes = null;
File tempDocx = null;
PDFDoc pdfDoc = null;
try{
PDFNet.initialize(webViewerLicense);
PDFNet.addResourceSearchPath(structureOutputPath); // Update path
PDFNet.addResourceSearchPath(“/usr/local/WebSphere/AppServer/customlib/apryse-webviewer/fonts”);
if (!StructuredOutputModule.isModuleAvailable()) {
throw new ServiceException("STRUCTURED_OUTPUT_MODULE_NOT_AVAILABLE");
}
pdfDoc = new PDFDoc(new ByteArrayInputStream(document);
tempDocx = File.createTempFile(docId.toString(), ".docx", new File(junkFilePath));
Convert.toWord(pdfDoc, tempDocx.getAbsolutePath());
fileBytes = Files.readAllBytes(tempDocx.toPath());
} catch (Exception e){
LoggerUtils.error(e);
throw new ServiceException(e.getMessage());
} finally {
if (tempDocx != null) tempDocx.delete();
if(pdfDoc != null) pdfDoc.close();
PDFNet.terminate();
}
LoggerUtils.logExit();
return fileBytes;
=> Kindly help with this scenario