Reading contents of Word, PDF file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
i have this use case where i need to read the contents of CV/resume uploaded by users and pass it to a LLM to extract the skills. Currently, I am only able to do so using a txt file (refer to the below code). But when i use this code on a pdf or word file, the contents are all weird symbols. Can anyone point me in the right direction?
code:
extractSkillsFromCV: function() {
var tableSysId = this.getParameter('sysparm_tableSysId');
var grAttach = new GlideRecord("sys_attachment");
grAttach.addEncodedQuery("table_sys_id=" + tableSysId);
grAttach.query();
if(grAttach.next()){
var document;
var attach = new GlideSysAttachment().getContentStream(grAttach.sys_id);
var reader = new GlideTextReader(attach);
var ln = ' ';
while ((ln = reader.readLine()) != null) {
document += ln + "\n";
}
return document;
}
0 REPLIES 0

