Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
207 stars 77 forks source link

Variable in file name #79

Open foscone opened 6 years ago

foscone commented 6 years ago

Hi, is there a way to use a variable for a part of file name?

I'm thinking of something like: <button onclick="return xepOnline.Formatter.Format('container',{ pageWidth:'210mm', pageHeight:'297mm', render:'download', filename: `name-${variable}` });">PDF</button>

Thanks

jirodearmas commented 6 years ago

I was able to use a PHP variable for the file name of the PDF. Don't know if it's possible for a JS variable. This is what I used. filename:'<?php echo $filename; ?>'