CalcBuilder Forum

PDF Output

User nashm 2017-06-12 13:04:16

I am trying to format my PDF on a single page where input is on the left side and the output is on the right side of the page (two columns). My output is table and, no matter what i try, it is always aligned on the left side of the page. I tried with divs and all sorts of HTML alignment, but no success. Also, I would like to change fonts on PDF. How can I do this?

Moonsoft support 2017-06-12 15:46:42

Hi,
we assume you're including both input and output using default layout at the print preferences setting? If so, you can try to create a new layout at this section, including all needed information at any of the free content fields, for ex: inside 'html before calc results', you can include a table with a couple of columns there, and copy your form layout and your output section html inside.

Regarding fonts or other styles, the library allows to use a wide set of inline styles, for ex:

div style="font-size: 10pt;"

that you can use to give a better format to your pdf. We share a link to the official docs of the library so you can check all options available, please let us know if you need further help with this:

https://mpdf.github.io/html-support/html-attributes.html


Regards

User nashm 2017-06-13 19:50:35

Thank you, putting inputs and outputs in a table worked perfectly! I have a problem now, though - pdf shows in Chrome and Firefox (will not open in IE), but if I want to download it or "save as" (Chrome), it will give me a "network error". In Firefox, I can download it but I have to give it .pdf extension manually, so I can open it. File name that shows in the browser is actually name of my menu item, and I noticed there is no .pdf in filename. What would be the problem here?

Moonsoft support 2017-06-13 20:08:26

Hi,
the download process depends on each browser configuration, for ex the chrome message means you have somehow blocked some downloads:

https://productforums.google.com/forum/#!topic/chrome/7XBU6g6_Ktc

if we try with firefox here we get a .pdf download at the filename, so we suggest to check if is also a browser issue trying the demo calculator here:

http://demo.moonsoft.es/demo25/index.php/calcbuilder

the last one (inline results) show a pdf to download. Please let us know if you get a different result there.

We look forward your feedback about the test.

Thanks, regards

User nashm 2017-06-14 01:48:07

Thank you! Yes it must be something with my browsers, as your demo calculator behaves exactly the same way as my calculator. I will try to fix it & publish results if I figure it out! Thanks again!

...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!