Skip to main content

Posts

Showing posts from May, 2018

HTML Object Height Change In Percentage

SOLVED ! Problem : HTML Object in <object tag height could not able to change as in percentage
Solution : Add the below style and html object width and height in % ( percentage)

Html object may be anything like a PDF document , Microsoft word document,Tiff image or a video or any kind of object we can insert in html with object height and width in % percentage

Step 1 : 
<style> .body {     margin: 0;     padding: 0;     font-family: Verdana, Arial, Helvetica, sans-serif;     overflow: hidden;     min-width: 630px; } .html5container{     margin: 0;     padding: 0;     position: absolute !important;     width: 100% !important;     height: 100% !important; } .errordiv{ align : center; padding: 5px; background-color: #e0ebed; box-shadow: 1px -1px 19px 6px #888; margin-top: auto; margin-bottom: auto; margin-left: auto; margin-right: auto; } </style>

Step 2 :
<div class="html5container" width="100%" height="100%">

Merge Tiff Files Input Streams Using Java

SOLVED : Merge Tiff Input Stream list and combine as a single Tiff input stream using java Solution : public static InputStream mergeTiffFiles(InputStream[] contentElements) throws IOException { List<BufferedImage> images = new ArrayList<BufferedImage>(); SeekableStream ss =null; try { if(contentElements.length==1) { return contentElements[0]; } //Iterate over each content element positioned at 0,1,2 in Filenet for(InputStream contentElement:contentElements) { ImageDecoder decoder = ImageCodec.createImageDecoder("tiff", contentElement, null); int numPages = decoder.getNumPages(); //Iterate over each page of the given document and add it to list of buffered images for(int j = 0; j < numPages; j++) { PlanarImage op = new NullOpImage(decoder.decodeAsRenderedImage(j), null, null, OpImage.OP_IO_BOUND); images.add(op.getAsBufferedImage()); } } …

Download file with extension for internet explorer and chrome using javascript

SOLVED Problem Statement :
Internet explorer download file does not shows file extension

Solution : java script code that append file type extension

function save() { var fileUrl = "${fileUrl}"; var fileName = "${fileName}"; var mimeType = "${mimeType}"; var ie = navigator.userAgent.match(/MSIE\s([\d.]+)/), ie11 = navigator.userAgent .match(/Trident\/7.0/) && navigator.userAgent.match(/rv:11/), ieEDGE = navigator.userAgent .match(/Edge/g), ieVer = (ie ? ie[1] : (ie11 ? 11 : (ieEDGE ? 12 : -1))); if (ie && ieVer < 10) { console.log("No blobs on IE ver<10"); return; } if (ieVer > -1) { console.log(" blobs on IE ver>10"); //window.open(fileUrl,"_self");        var xhr = new XMLHttpRequest(); xhr.open('GET', fileUrl, true); xhr.responseType = 'blob'; xhr.onload = function(e) { if (this.status == 200) { var myBlob = this.response; downloadFileForIE(myBlob, fileName, mimeType); } }; xh…