eForm programming notes

Converting PDF images to PNG

Open PDF with Inkscape:
– File, Export Bitmap (high resolution is good)
Open Bitmap file with IrfanView:
– crop borders: select area, Edit, Crop Selection (Ctrl-Y)
– adjust resolution to 1500 x 2000: Image, Resize/Resample, Width 1500, Height 2000 max, DPI 600
– reduce color depth to 16 colours: Image, Decrease Color depth, 16 Colors
– save as .PNG

Auto refresh eForm changes

Adding the following line to your eForm will force it to automatically refresh every 5 seconds, which is great when changing code in one window and viewing the results in another.

<meta http-equiv="refresh" content="5" >

Accent conversion

The RTL needs correct HTML codes for the accents.
This web site makes it easy to convert the text:
http://www.web2generators.com/html-based-tools/online-html-entities-encoder-and-decoder

Yes/No choices with XBox

<input name="HPTWaY" id="HPTWaY" type="text" class="Xbox" style="position:absolute; left:382px; top:580px; width:12px; height:12px; font-family:sans-serif; font-style:normal; font-weight:bold; font-size:14px; text-align:center; border:1px solid #000000; background-color:transparent;" onkeypress="javascript:return displayKeyCode(event,this.id);" onClick="document.FormName.HPTWaN.value='';">
<input name="HPTWaN" id="HPTWaN" type="text" class="Xbox" style="position:absolute; left:435px; top:580px; width:12px; height:12px; font-family:sans-serif; font-style:normal; font-weight:bold; font-size:14px; text-align:center; border:1px solid #000000; background-color:transparent;" onkeypress="javascript:return displayKeyCode(event,this.id);" onClick="document.FormName.HPTWaY.value='';">

Yes/No choices with checkboxes

<script language="javascript">
function ChkBoxYN(checkboxid,uncheckboxid) { 
 if(document.getElementById(checkboxid).checked==true) { 
 document.getElementById(uncheckboxid).checked=false;
 }
}
</script>
<input name="physy" id="physy" type="checkbox" class="largerCheckbox" style="position:absolute; left:140px; top:211px;" onclick="ChkBoxYN('physy','physn');">
<input name="physn" id="physn" type="checkbox" class="largerCheckbox" style="position:absolute; left:187px; top:211px;" onclick="ChkBoxYN('physn','physy');">

Multipage creation

Split multi-page PDF into PNGs
– Open with Acrobat.
– Delete other pages. Document, Delete Pages (Shift+Ctrl+D)
– Save as <filename>-Px.PNG
– Close, Don’t save changes
– Repeat for each page.

Edit images to 1500 pixels wide
– Open with Irfanview
– Image Information show info
– Select area (to crop extra borders)
– Edit, Crop selection (Ctrl+Y)
– Image, Resize/Resample, Set new size, Width = 1500, Height = 1960, Preserve aspect ratio (proportional) OFF
– Image, Decrease Color Depth, 2 Colors (black/white) (1 BPP)
– Repeat for each page.

Copy final cropped, monochrome documents into eForm Generator folder

eForm Generator
– Enter: Image Name; Click: Load Image
– should show Page 1
– Create fields on form

– Repeat for each page

As you go, click on ‘Load HTML code in new window’ and cut/paste for safe-keeping

 

This entry was posted in Technical and tagged . Bookmark the permalink.