I am working on a Data extract from a Lotus Notes Application. It stores legal documents which may have attachments and images (not mails). I want to convert notes documents to HTML. While importing the data using java API I am able to extract Text, Attachments etc but when it comes to images I am not able to extract them. I did some research and found about two approaches
1) To extract the document using generateXML() method. But the generated document contains a picture tag which has a referenece of location on Notes Domino server. But I want the image so that it can be included in the HTML document.
2) By extractinh as MIME Entity. When I try to get images using getMIMEEntity("Body") or any other field I do not get any image and It always return null.
There is question (Extract inline images from Lotus Notes using Lotus Notes Java API) which deals with this but It does not answers conclusively and its dormant for a long time.
Please help, I am working on it for a couple of days still I cannot import images. Thanks in advance.
In Lotusscript you can first Extract file to your local system/ Server and than export in excel by using that code below.
' Loop through all attachment/document (By creating attachment object)and save Image to some path on server/local 'system(strSaveasPath)
Call object.ExtractFile( strSaveAsPath)
' Now Activate excel row:column range where you wnat to insert image
xlApp.Range("1:1").Activate
xlApp.ActiveSheet.Pictures.Insert(strSaveAsPath)
Related
I am working on a project where i have to extract information from PDF documents. While the documents follow similar format, few documents are slightly different in their format, how do i handle this using python.
I am working with form 483 available on the FDA website.
Site Link
I want to extract employee information mentioned at the bottom of the page. The format of document varies slightly. How can I extract information.
Example Documents:
https://www.fda.gov/media/101442/download
https://www.fda.gov/media/135387/download
https://www.fda.gov/media/89200/download
This isn't a question, but I wanted to share the solution since I wasn't able to find much about it googling.
I am creating a tool for my company using PowerApps. I needed to store a set of data along with 2 pictures for each entry. The data and pictures were stored in pdf files, I parsed the data out, and encoded the pictures into a base64 string (Field: VarChar MAX), using PowerShell and uploaded it into a SQL (2005) server onsite. I connected my onsite SQL server to PowerApps through the Gateway program provided by PowerApps.
My problem was displaying the stored pictures in the application, without using any different data connectors or extreme coding.
Using the IMAGE object, Image.image = "data:image;application/octet-stream;base64,"&PassingID.PictureOpen
where PassingID.PictureOpen = the Base64 string.
Using the IMAGE object, Image.image = "data:image;application/octet-stream;base64,"&PassingID.PictureOpen
where PassingID.PictureOpen = the Base64 string.
The really important part here is using quotes "", and data:image;application/octet-stream;base64,
You can replace image with audio, for audio features.
I assume a similar setup can be used in the Gallery object as well.
I have a submit only XPage based form that has an inputRichText field for storing screenshots and a multi file upload (using the XPages Multiple File Uploader from OpenNTF) for uploading one or more attachments. When submitted I need both the screenshots and the attachments to appear in a single rich text field which will be accessed via the Notes Client only (non XPages).
Currently the form stores the attachments and screenshots in separate fields. I have tried appending one field to the other on save (using SSJS in the submit button, however because the Screenshots are stored as MIME and the attachments as NotesRichText, it is not letting me do it.
Is there some way (preferably in SSJS) that I can convert either the MIME to RichText or vice versa so that I can append one field to the other? I have tried searching for various solutions to no avail, as well as trying different file upload controls from OpenNTF.
Ideally I need something like this to work:
var rtItemAttachments:NotesRichTextItem = docTo_Backend.getFirstItem("attachments"); //This is the field I want everything in
var rtItemFiles:NotesRichTextItem = docTo_Backend.getFirstItem("uploadedFiles");
rtItemAttachments.appendRTItem(rtItemFiles); //Fails on this line
docTo_Backend.removeItem("uploadedFiles");
Speak after me: there is no RichText in the web, all there is is MIME.
You can set the RT field to store its content in MIME (a property). This makes things much easier.
To stitch things together you need to stick with MIME. These are roughly the steps
Get the text and images as MIME
Get your attachments as stream (the embeddedObjects has a method for that)
Convert the stream to BASE64 and create a new mime-part with it. (Looking at an attachment eMail source someone sent through the internet should give you a pretty good idea how it looks like)
You end up with:
MimeHeader
MimePart for Text (HTML)
MimePart for Screenshots (if they are not inline images in html)
MimeParts for attachments
The special effect: if you add to the HTML with links to the attachments, it looks nicer.
Of course the BIG question: WHY?
You could simply design a Notes form that has two fields, no need to fold it into one. Hope that helps.
A good piece of code to look at to understand the MIME stuff is the OpenNTF eMail bean
I have a download control bound to a rich text field. My users are finding that some documents cause errors. Right now, I have an XPage that has little more than the rich text field on it. For example, when I attach a certain .docx file to a document using the Notes client, then try to download the attachment via the Web using the download control on an xpage, I get a runtime error stating that there is an invalid date. I actually get the error just by trying to open the XPage, before I even get a chance to click on the link within the download control. But neither the xpage nor the attachment have any date field on them. Other attachments don't cause the error, even other .docx documents. And if I convert the .docx to .doc, the problem goes away. But I can't tell my users to never attach .docx documents. Does anyone have any idea why some .docx (not all, though) documents attached to a Notes document would cause such a runtime error in XPages?
How can I convert an .nsf lotus file to a text file? i want to write a java program to read .nsf file which is on my system. i have tried it simply but it is showing non english character is their any way to get access them normaly.
EDIT:
That code is in .net and using any server's session, I just want to read .nsf file by java without creating any server's session in fact i have .nsf database. i just want to read as a text file.if there a way to parse .nsf with javacc,it would be better enough......
lotus notes database is full of proprietary design components. Assuming you just want to export the data, you will need to write an agent, (aka batch process), that would look at all documents in the database and then export all the fields into a plain text file.
If you're into XML, you can export data in that format as well, but again, you will need to write an agent for that.
Alternatively, there are some basic builtin mechanisms in Lotus Notes to export data but this is restricted to running them from views. Views do no necessarily get all the documents. You can design a view to do that though.
Providing the size of the database is not extremely large, (less than 200k documents), you can create view listing all the columns you want to export and a view formula that has "Select #All", will give you all documents. Then, the "quickest" way to get data out from a view can be found here using simple export procedure.
There is still the issues of exporting rich media, you can have a look here for that.
You can export some data easily by selecting all the documents in a view, and then going to Edit > Copy Selected As Table. Then just paste the content into Excel or a text file.
To access the data beyond what is showing in a view, you can try a few other things:
Connect to the data using the NotesSQL driver
Connect via the COM api (using Java, C#, VB, etc)
Create some views in Lotus Notes that DO have the data you need, and use my recommendation above.
Install and and my Export to Excel application