Changes

Create PDF Document with JavaScript

1,056 bytes added, 18:48, 4 January 2013
Created page with ' Many SmartSimple components can be easily converted to PDF using baseline functionality such as the Web Page View Field. It is also possible to generate PDF documents from…'

Many SmartSimple components can be easily converted to PDF using baseline functionality such as the [[Web Page View Field]].

It is also possible to generate PDF documents from any HTML encoded text. For example:
* Reports
* [[Web Page View Field]] if you wish to manipulate the HTML using JavaScript prior to generating the PDF. (Using the standard feature to convert Web Page View into a PDF will will render using the initial HTML and not the HTML after being manipulated by JavaScript)



This is accomplished by submitting a form containing an input named '''"txt"''' to the SmartSimple '''pdfWriter''' page.


For example, to convert a report to PDF you could add the following code to the

<pre>
<div style="pd4ml-display:none">
<form name="CreatePDF" action="/pdfWriter" method="POST">
<input type="hidden" id="PDFcontent" name="txt"/>
<input type=submit class="Button" value="Create PDF" onclick="this.form.txt.value=document.getElementsByTagName('HTML')[0].outerHTML;">
</form>
</div>
</pre>




[[Category:PDF]][Category:JavaScript]]
0
edits