<?php
add_action( 'wp_ajax_get_pdf_url', 'haet_ajax_get_pdf_url' );
function haet_ajax_get_pdf_url() {
	?>
		<a href="<?php if(function_exists('wp2pdf')){ echo wp2pdf(array(id => $_POST['id'], template => 'my_pdf_template', filename => 'PDFPost-'.$_POST['id'], restricted => false,	cache => true )); } ?>" class="button">
			Download PDF &raquo;
		</a>
	<?php
	die();
}
?>