tomq0608 Also - the output when triggering the pdf_create() function is correct, it is only when you click "Save" it breaks.
What you see on that page is HTML not PDF at this point. It is the container that the PDF will be generated from. The "Save" action generates the PDF and starts the download process. Your PDF "breaks" because the library (jsPDF) cannot work with what you are giving it. Printing the page will not give you any useful PDF, just a regular HTML print - you can do this at any time with CTRL+P.
The frontend PDF generation feature is a limited solution to allow some PDF generation via basic HTML. It is not particularly powerful nor easy to use.
We wanted to add a visual PDF editor to r3.10 (the current release) that can take data from multiple sources and allow for drag & drop page building - but ran into issues/limitations with the libraries we were trying to integrate. We plan to continue the work and hope to get this feature into the next release(s).
tomq0608 Is it possible to specify different margins for the left and right margin?
Currently not. I´ll have a look at the next patch release so that we can take array inputs for the X/Y margins (so [10,20] for X margins would mean 10 left and 20 right or something like that).
tomq0608 Alternatively is it possible to navigate to a URL with parameters from a frontend function? This way I could host the html somewhere else and transfer the data over that way
I am not sure what you mean by this. What data would you transfer? If you mean HTML data to be printed by pdf_create()
you´d still be limited by jsPDF. If you mean sending data to another system to use another PDF engine, you could use API calls for that.