HOME

Products
The Arc
HTML to PDF

Free CollinsPDF.js
Free CollinsHTML.js
Free GIS

(on-line service)
CustomerCareSystem
Scripts
 
CollinsHTML.js 100% JavaScript
HTML Parser with output to PDF (version 1.14)

Client or Server side HTML Parser
FREE DOWNLOAD

Updated Aug 7, 2010 

graphic compatible to V7
fix header alignment
ruler tab characteristics

A JavaScript Object to Parse HTML to create PDF documents.

http://
This example is in development to create a 1 page pdf document from a web address

See also:
    Free Download CollinsPDF.js which contains other examples specific to the PDF object

   
on-line Example
: HTML to PDF with a set of pre-built HTML examples
   
on-line Example
: HTML Editor with output to PDF

Capabilities of CollinsHTML for the creation of PDF files:

  • Pagination
  • Run from Client or ASP Server
  • Cascade Style Sheets
  • Margins, Padding, Borders
  • Vertical and horizontal alignments
  • Tables
  • Relative and Absolute positioning
  • Images (Jpeg only)
  • PDF properties <PDF ...> tag
  • tags supported:
    <A><CENTER><LI><OL><UL><DIV><SPAN><FONT><IMG><TABLE><TR><TD><TFOOT><THEAD>
    <BR><P><SUP><SUB><B><U><I><H1><H2><H3><H4><H5><H6><HR>
    <BLOCKQUOTE>
  • Augmented Statements
  • Report Generation Statements Header / Footer / Groups / Details in HTML from database
  • Graphic Commands
<font size=4 color=blue>Plot Sine and Cosine Wave Without JavaScript</font> <br>

<loop id=x min=0 max=360 increment=5>
<Store id=sin value="{x}:{eval(Math.sin({x.radian}) * 100 + 100)}">
<Store id=cos value="{x}:{eval(Math.cos({x.radian}) * 100 + 100)}">
</loop>

<graphic border=0 height=260 width=400 range="0,0,100,200">
Graph Black,1,solid,0.97,0,0,200,360,Black,12,,0,360,8,

4,Black,1,solid,0,true,-1,1,10,4,Black,1,solid,2,true;
Line Blue,4,,0,{sin.join};
Line Red,4,,0,{cos.join};
</graphic>

  • Monthly Calendar with events
     
    <font size=5 Color=Blue>Monthly Calendar Example</font><br>

    <calendar year=2010 width=500 height=500 border=3 Month=Dec>

    <event day=6 style="Background-Color:yellow">

    <font size=3 >Saint Nicholas</font>
    </event>

    <event day=25 border=2 style="Background-Color:yellow">
    <img src=c.jpg><font size=3>xmax</font>
    </event>

    </calendar>

  • Time Line

<timeline Height=100 Width=500 Start="Jan 1, 2010" Duration="1 Year" Resolution=day eventMaxLevels=3 eventFontColor=black eventFontSize=8 eventFontName=Arial eventAlign=center eventPlacement=updown eventHeight=20 eventWidth=60 eventBorder=0 EventMarkerShape=box EventMarkerColor=blue EventMarkerSize=8 leaderSlant=0 leaderWidth=1 leaderColor=black leaderStyle=solid LeaderType=box
baselineWidth=1 baselineLabels=Month baselineTics=0 baselineFontSize=6 baselineFontColor=black eventColor=Yellow>

<event date="Dec 25, 2010">Christmas</event>
<event date="Jan 1, 2010">New Years</event>
<event date="July 4, 2010" color=red>4th of July</event>
<event date="Nov 23, 2010">Thansgiving</event>
<event date="Feb 2, 2010">Groundhog Day</event>
<event date="Feb 14, 2010">Valentine's Day</event>
<event date="Feb 14, 2010">Chinese New Year</event>
<event date="Mar 17, 2010">Patrick's Day</event>
</timeline>

Client Side - Minimum Code:

<html><head>
<script src="collinsPdf.js" language="javascript"></script>
<script src="collinsHtml.js" language="javascript"></script>
<script>
function createPdf()
{
    html = new html$()
    pdf = new pdf$();   

    html.parse("<B> Hello World</B>");

    html.writeToPdf(pdf);

    pdf.writeToFile('c:/temp/hello_world.pdf');
    window.open('file://c:/temp/hello_world.pdf');
}
</script>
</head><body>
<input type=button value="Create Pdf file" onClick=createPdf()>
</body></html>


Server Side - Minimum ASP Code:

<%@ language=javascript%>
<script SRC="collinsPdf.js" language="JavaScript" runat="Server"></script>
<script SRC="collinsHtml.js" language="JavaScript" runat="Server"></script>
<%
   html = new html$();

   pdf = new pdf$();   

   html.parse("The Date is: <b><i>" + new Date() + "</i></B>");
   html.writeToPdf(pdf);

   pdf.sendToClient('sample_asp.pdf');
%>