<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>MachForm Community Forums Topic: PDF output - I really would like to find a solution</title>
<link>https://www.machform.com/forums/</link>
<description>MachForm Community Forums Topic: PDF output - I really would like to find a solution</description>
<language>en</language>
<pubDate>Sun, 03 May 2026 23:06:28 +0000</pubDate>

<item>
<title>yuniar on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16583</link>
<pubDate>Sun, 02 Dec 2012 16:51:17 +0000</pubDate>
<dc:creator>yuniar</dc:creator>
<guid isPermaLink="false">16583@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;You can edit the &#34;confirm.php&#34; and &#34;confirm_embed.php&#34; files (they are pretty much identical). Search around line 30 for this code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(!empty($_POST[&#38;#39;review_submit&#38;#39;]) &#124;&#124; !empty($_POST[&#38;#39;review_submit_x&#38;#39;])){ //if form submitted&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You can put your code exactly below that line. It should be executed once, when the review page being submitted.
&#60;/p&#62;</description>
</item>
<item>
<title>timothykrulan on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16578</link>
<pubDate>Fri, 30 Nov 2012 22:21:43 +0000</pubDate>
<dc:creator>timothykrulan</dc:creator>
<guid isPermaLink="false">16578@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Ok - so here's where I stand on producing a pdf of the completed form ...&#60;/p&#62;
&#60;p&#62;The contents of   &#60;code&#62;$markup&#60;/code&#62; at then end of  confirm.php will work for me as the pdf file.  I would like it not to have the Submit and Previous footer included in it -  but can live with that for now.&#60;/p&#62;
&#60;p&#62;I've installed  wkhtmltopdf on the server (version 10 - not the current version becuase the current version did not convert the signature field properly without X being installed and running) &#60;/p&#62;
&#60;p&#62;I can write out &#60;code&#62;$markup&#60;/code&#62; to a file and the use &#60;code&#62;shell_exec&#60;/code&#62; to run the wkhtmltopdf command to convert the file to a pdf.&#60;/p&#62;
&#60;p&#62;I just want it to only run when the user clicks Submit for the last time after their review and the program is just about to write the data into the database.&#60;/p&#62;
&#60;p&#62;I just dont know where to fire off my code so it only happen once and at this time?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
</item>
<item>
<title>timothykrulan on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16538</link>
<pubDate>Thu, 22 Nov 2012 05:07:47 +0000</pubDate>
<dc:creator>timothykrulan</dc:creator>
<guid isPermaLink="false">16538@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;What I want is to just take the page displayed on the confirmation and convert it to a pdf.  Even better if I could get it without the SUBMIT and PREVIOUS buttons at the bottem.&#60;/p&#62;
&#60;p&#62;I found that all of the html for the confirm page is stored in $markup.  I am currently writing this out to a unique file and start to play from there with converting it to a pdf..
&#60;/p&#62;</description>
</item>
<item>
<title>shannonrobertson on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16527</link>
<pubDate>Tue, 20 Nov 2012 12:35:44 +0000</pubDate>
<dc:creator>shannonrobertson</dc:creator>
<guid isPermaLink="false">16527@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;It would probably be easier to make a form.&#60;br /&#62;
have you contract text in a section break.&#60;br /&#62;
have the section break hidden.&#60;br /&#62;
then have the form emailed to them when it's complete.&#60;br /&#62;
That way they can just print the email.
&#60;/p&#62;</description>
</item>
<item>
<title>chinuba on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16525</link>
<pubDate>Tue, 20 Nov 2012 11:56:01 +0000</pubDate>
<dc:creator>chinuba</dc:creator>
<guid isPermaLink="false">16525@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Is it possible to take the output of a form eg Name and address and input it to specific fields in the PDF?&#60;/p&#62;
&#60;p&#62;I am asking this because I have a contract that users should have but instead of mailing it to them, They can just input their name and address into the form and then it generates a PDF with the name and address in specific fields that the customer can download and print.&#60;/p&#62;
&#60;p&#62;Any help is appreciated.
&#60;/p&#62;</description>
</item>
<item>
<title>DaveVoss on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16523</link>
<pubDate>Tue, 20 Nov 2012 11:09:54 +0000</pubDate>
<dc:creator>DaveVoss</dc:creator>
<guid isPermaLink="false">16523@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Are you trying to capture the grid of all the entries or all of the informaion from one entry on the page where you view an entire entry?
&#60;/p&#62;</description>
</item>
<item>
<title>shannonrobertson on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16522</link>
<pubDate>Tue, 20 Nov 2012 07:58:40 +0000</pubDate>
<dc:creator>shannonrobertson</dc:creator>
<guid isPermaLink="false">16522@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Well it’s not that simple, but luckily once again I had to do this so here is the code.&#60;br /&#62;
I think that’s it for general modifications :).&#60;br /&#62;
Here is the jist of what to do,&#60;br /&#62;
Like everything this has a few downsides, a unsecured view form file,&#60;br /&#62;
Uses a lot of resources when it runs,&#60;br /&#62;
And you will still need to do a fair bit of work with css to get the output pdf looking a bit better.&#60;/p&#62;
&#60;p&#62;You will need&#60;br /&#62;
&#60;a href=&#34;http://code.google.com/p/dompdf/&#34; rel=&#34;nofollow&#34;&#62;http://code.google.com/p/dompdf/&#60;/a&#62;&#60;br /&#62;
and &#60;a href=&#34;https://github.com/thomasjbradley/signature-to-image/&#34; rel=&#34;nofollow&#34;&#62;https://github.com/thomasjbradley/signature-to-image/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Step 1 placing the PDF link&#60;br /&#62;
Go to entry-functions.php&#60;br /&#62;
And replace these 2 lines&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$table_header_markup .= &#38;#39;&#38;lt;th class=&#38;quot;me_action&#38;quot; scope=&#38;quot;col&#38;quot;&#38;gt;&#38;lt;input type=&#38;quot;checkbox&#38;quot; value=&#38;quot;1&#38;quot; name=&#38;quot;col_select&#38;quot; id=&#38;quot;col_select&#38;quot; /&#38;gt;&#38;lt;/th&#38;gt;&#38;#39;.&#38;quot;\n&#38;quot;;

$table_body_markup .= &#38;#39;&#38;lt;td class=&#38;quot;me_action&#38;quot;&#38;gt;&#38;lt;input type=&#38;quot;checkbox&#38;quot; id=&#38;quot;entry_&#38;#39;.$column_data.&#38;#39;&#38;quot; name=&#38;quot;entry_&#38;#39;.$column_data.&#38;#39;&#38;quot; value=&#38;quot;1&#38;quot; /&#38;gt;&#38;lt;/td&#38;gt;&#38;#39;.&#38;quot;\n&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;With&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$table_header_markup .= &#38;#39;&#38;lt;th class=&#38;quot;me_action&#38;quot; scope=&#38;quot;col&#38;quot;&#38;gt;&#38;lt;/th&#38;gt;&#38;lt;th class=&#38;quot;me_action&#38;quot; scope=&#38;quot;col&#38;quot;&#38;gt;&#38;lt;input type=&#38;quot;checkbox&#38;quot; value=&#38;quot;1&#38;quot; name=&#38;quot;col_select&#38;quot; id=&#38;quot;col_select&#38;quot; /&#38;gt;&#38;lt;/th&#38;gt;&#38;#39;.&#38;quot;\n&#38;quot;;

$table_body_markup .= &#38;quot;&#38;lt;td &#38;gt;&#38;lt;a href=&#38;#39;pdfbridge.php?form_id=&#38;quot;.$form_id.&#38;quot;&#38;#38;entry_id=&#38;quot;.$column_data.&#38;quot;&#38;#39;&#38;gt;&#38;quot;.&#38;#39;PDF&#38;#39;.&#38;quot;&#38;lt;/a&#38;gt;&#38;lt;/td&#38;gt;&#38;quot;.&#38;#39;&#38;lt;td class=&#38;quot;me_action&#38;quot;&#38;gt;&#38;lt;input type=&#38;quot;checkbox&#38;quot; id=&#38;quot;entry_&#38;#39;.$column_data.&#38;#39;&#38;quot; name=&#38;quot;entry_&#38;#39;.$column_data.&#38;#39;&#38;quot; value=&#38;quot;1&#38;quot; /&#38;gt;&#38;lt;/td&#38;gt;&#38;#39;.&#38;quot;\n&#38;quot;;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Now you have a pdf link on your output rows.&#60;/p&#62;
&#60;p&#62;Step 2 the PDF bridge file&#60;br /&#62;
Create a file called pdfbridge.php in the machforms root. &#60;/p&#62;
&#60;p&#62;And place this in there&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php

include_once($_SERVER[&#38;#39;DOCUMENT_ROOT&#38;#39;].&#38;#39;/dompdf/dompdf_config.inc.php&#38;#39;);
$form_id = $_GET[&#38;#39;form_id&#38;#39;];
$pdfentryid = $_GET[&#38;#39;entry_id&#38;#39;];
$html = file_get_contents(&#38;quot;http://&#38;quot;.$_SERVER[&#38;quot;SERVER_NAME&#38;quot;].&#38;quot;/machform/view_pdf.php?form_id=&#38;quot;.$form_id.&#38;quot;&#38;#38;entry_id=&#38;quot;.$pdfentryid);        

$dompdf = new DOMPDF();
$dompdf-&#38;gt;load_html($html);
$dompdf-&#38;gt;render();
$dompdf-&#38;gt;stream(&#38;#39;file.pdf&#38;#39;);      

header(&#38;quot;http://&#38;quot;.$_SERVER[&#38;quot;SERVER_NAME&#38;quot;].&#38;quot;machform/manage_entries.php?id=&#38;quot;.$form_id);
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Step 3 the page we want the output PDF of,&#60;br /&#62;
Now this is where the majority of the work will be.&#60;/p&#62;
&#60;p&#62;Copy view_entry.php and rename the new file to view_pdf.php&#60;/p&#62;
&#60;p&#62;Place this line in the includes section of view_pdf.php&#60;/p&#62;
&#60;p&#62;&#60;code&#62;require_once &#38;#39;./signature-to-image.php&#38;#39;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;and remove this line &#60;/p&#62;
&#60;p&#62;&#60;code&#62;require(&#38;#39;includes/check-session.php&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;replace this &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$signature_markup = &#38;lt;&#38;lt;&#38;lt;EOT
									        &#38;lt;div id=&#38;quot;mf_sigpad_{$element_id}&#38;quot; class=&#38;quot;mf_sig_wrapper {$data[&#38;#39;element_size&#38;#39;]}&#38;quot;&#38;gt;
									          &#38;lt;canvas class=&#38;quot;mf_canvas_pad&#38;quot; width=&#38;quot;{$canvas_width}&#38;quot; height=&#38;quot;{$canvas_height}&#38;quot;&#38;gt;&#38;lt;/canvas&#38;gt;
									        &#38;lt;/div&#38;gt;
									        &#38;lt;script type=&#38;quot;text/javascript&#38;quot;&#38;gt;
												$(function(){
													var sigpad_options_{$element_id} = {
										               drawOnly : true,
										               displayOnly: true,
										               bgColour: &#38;#39;#fff&#38;#39;,
										               penColour: &#38;#39;#000&#38;#39;,
										               output: &#38;#39;#element_{$element_id}&#38;#39;,
										               lineTop: {$line_margin_top},
										               lineMargin: 10,
										               validateFields: false
										        	};
										        	var sigpad_data_{$element_id} = {$data[&#38;#39;value&#38;#39;]};
										      		$(&#38;#39;#mf_sigpad_{$element_id}&#38;#39;).signaturePad(sigpad_options_{$element_id}).regenerate(sigpad_data_{$element_id});
												});
											&#38;lt;/script&#38;gt;
EOT;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with this&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$defaultOptions = array(
    &#38;#39;imageSize&#38;#39; =&#38;gt; array($canvas_width, $canvas_height)

);

$img = sigJsonToImage($data[&#38;#39;value&#38;#39;], $defaultOptions);

imagepng($img, &#38;#39;signature&#38;#39;.$element_id.&#38;#39;.png&#38;#39;);

			$signature_markup = &#38;lt;&#38;lt;&#38;lt;EOT
									        &#38;lt;div id=&#38;quot;mf_sigpad_{$element_id}&#38;quot; class=&#38;quot;mf_sig_wrapper {$data[&#38;#39;element_size&#38;#39;]}&#38;quot;&#38;gt;
									        &#38;lt;img src=&#38;quot;signature{$element_id}.png&#38;quot;&#38;gt;
									        &#38;lt;/div&#38;gt;

EOT;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Take note 'imageSize' =&#38;gt; array($canvas_width, $canvas_height) implies that you have a $canvas_width variable which isn't standard.&#60;/p&#62;
&#60;p&#62;This make the image become a png and saves it to the server so that the pdf can pick it up and attach.&#60;/p&#62;
&#60;p&#62;Finally add this to the top of signature-to-image.php&#60;/p&#62;
&#60;p&#62;&#60;code&#62;ini_set(&#38;#39;memory_limit&#38;#39;, &#38;#39;-1&#38;#39;);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;this gives signature-to-image php a lot more resources so it can render giant signature which I us in the sketch pad modification.&#60;/p&#62;
&#60;p&#62;This is a good start I probably forgot something but you should be able to work out what that might be. Also with the url’s they are matched to my system, so most likely they will need to be changed.
&#60;/p&#62;</description>
</item>
<item>
<title>AMurray on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16521</link>
<pubDate>Tue, 20 Nov 2012 04:59:02 +0000</pubDate>
<dc:creator>AMurray</dc:creator>
<guid isPermaLink="false">16521@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;There are many PDF creator scripts (written in PHP out there) but I don't know how easy to implement into Machform - specifically the review page.&#60;/p&#62;
&#60;p&#62;Someone with PHP skills on this forum might be able to give some pointers.&#60;/p&#62;
&#60;p&#62;First page of Google results searched for &#34;web page to pdf PHP script&#34;: &#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://www.google.com.au/search?q=web+page+to+pdf+PHP+script&#38;#38;ie=utf-8&#38;#38;oe=utf-8&#38;#38;aq=t&#38;#38;rls=org.mozilla:en-US:official&#38;#38;client=firefox-a&#34; rel=&#34;nofollow&#34;&#62;https://www.google.com.au/search?q=web+page+to+pdf+PHP+script&#38;#38;ie=utf-8&#38;#38;oe=utf-8&#38;#38;aq=t&#38;#38;rls=org.mozilla:en-US:official&#38;#38;client=firefox-a&#60;/a&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>timothykrulan on "[closed] PDF output - I really would like to find a solution"</title>
<link>https://www.machform.com/forums/topic/pdf-output-i-really-would-like-to-find-a-solution#post-16516</link>
<pubDate>Mon, 19 Nov 2012 22:37:51 +0000</pubDate>
<dc:creator>timothykrulan</dc:creator>
<guid isPermaLink="false">16516@https://www.machform.com/forums/</guid>
<description>&#60;p&#62;Has anyone tried to redirect the output of the Review Enry Page to a file to create a pdf of the data?  If so how has it worked for you?&#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
</item>

</channel>
</rss>
