0

I need to display uploaded scans (JPG, PNG, TIFF, PDF, etc.) in the browser's window instead downloading them to a local pc and using external apps like Acrobat Reader. I made some research in the web on that issue but wasn't really successful.

Does anyone have hints, code snippets, how to achieve that ?

EDIT :

Since I am not looking for a solution which supports viewing scans in a typical browser like Chrome, FireFox, etc. but supports viewing scans in an XPage view within Notes I need to ask my question again.

What is the best (recommended) way to view different types of scans, uploaded as PDF, JPG, TIFF, PNG, etc., in Notes within an XPage view ?

Ben
  • 677
  • 5
  • 19

1 Answers1

0

Take a look here, XPages: Embed PDF and possibly Office files

Here is some code that I have in an app for PDF's.

I tried using Bumpbox, and pdf.js and while I could get them working, iframes seemed to work best for me with using normal Domino attachment urls in xpages

I am not sure if this solution is right or not, but it works well for an app I have that only has PDFs. It does work on mobile too, at least on iOS.

<iframe
src="#{javascript:
var url = 'https://app.nsf/';

var doc = sessionScope.docID;


var atname = @RightBack(sessionScope.aname,'Body');



var end = '/$file'+atname;
return url+doc+end}"
    width="800" height="1000">
</iframe>

If you are looking at using different file types you need to use a renderer, give it the attachment URL, and then display what the renderer returns with. I haven't looked at this in a while so things might have changed. Look for a lightbox clone that can display pdf. I think Orangebox was one, bumpbox looks to not be updated but I was able to get that working for me.

This method will display everything inline. I would love to see some type of renderer like pdf.js for xpages.

Community
  • 1
  • 1
Patrick Sawyer
  • 1,362
  • 7
  • 22