go to post prashanth ponugoti · Oct 13, 2023 I have got an answer while searching in community pages. I have written below code , reading all text from pdf Class PRASHANTHNSPKG.ReadPDF Extends %RegisteredObject { /// zw ##class(User.PDF).GetText("/tmp/example.pdf", .text) ClassMethod GetText(file, Output text) As %Status { Try { #dim sc As %Status = $$$OK Kill text Set dir = $SYSTEM.Util.ManagerDirectory()_ "python" Do ##class(%File).CreateDirectoryChain(dir) /// C:\InterSystems\IRISHealth\bin>irispip install --target C:\InterSystems\IRISHealth\mgr\python PyPDF2 Try { Set pypdf2 = $SYSTEM.Python.Import("PyPDF2") } Catch { Set cmd = "irispip" Set args($INCREMENT(args)) = "install" Set args($INCREMENT(args)) = "--target" Set args($INCREMENT(args)) = dir Set args($INCREMENT(args)) = "PyPDF2" Set sc = $ZF(-100,"", cmd, .args) Set pypdf2 = $SYSTEM.Python.Import("PyPDF2") } Return:'$DATA(pypdf2) $$$ERROR($$$GeneralError, "Unable to load PyPDF2") Kill pypdf2 Set text = ..GetTextPy(file) } Catch ex { Set sc = ex.AsStatus() } Quit sc } ClassMethod GetTextPy(file) [ Language = python ] { from PyPDF2 import PdfReader reader = PdfReader(file) text = "" for page in reader.pages: text += page.extract_text() + "\n" return text } }
go to post prashanth ponugoti · Jan 26, 2022 Hi you can take any text editor and replace " with ""_" Example: "<book id="""_"bk105"""_"><author type="""_"old"""_">Corets, Eva</author><title>The Sundered Grail</title><genre>Fantasy</genre></book>"
go to post prashanth ponugoti · Jan 24, 2022 After a research , I have found the issue <assign value='source.Message.ReportType.content' property='target.Document.Description' action='set' /> content is missing in my DTL previously.
go to post prashanth ponugoti · Jan 11, 2022 http://localhost:52773/csp/healthshare/prashanthns/abc.xyz.TestService.c... it is opening in this path. here namespace is prashanthns service class name: abc.xyz.TestService. first part of production URL: http://localhost:52773/csp/healthshare
go to post prashanth ponugoti · Oct 13, 2021 Hi Robert, Can't thank enough .. That's just spot on...! Thank you so much for the detailed explanation, knowledge on these basic things are very much an asset for a newcomer like me. Thanks again.
go to post prashanth ponugoti · Oct 13, 2021 Thanks Robert, I extended my Namespace with %sys. Due to this I faced all the above issues. As per your suggestion, I have created new namespace extending HSSYS. Now all issues got resolved. Thank you so much for your help.