I can get one tab to export, and the PDF preview looks like it leaves a ton of space for the rest of the tabs to come over as well, however it only wants to export the first tab. Any suggestions on how to get around this?
Thanks for the code, looks like it is all outputting in the PDF print now. One last thing, is there a way to filter out all variables on the form that don’t have any data associated to it? This form has like 300+ fields and a lot of show/hide logic in it. It would be helpful to exclude any variables with no data in them.
Hi Nikita,
I was trying to understand this but the page that was referred to https://plumsail.com/docs/forms-sp/how-to/export-pdf.html has since been removed. I'm basically trying to create a button to print all tabs (except one) into a PDF. Is there another article somewhere?
I've now added a button to make the PDF option more noticeable and to also save the PDF with a specific name.
It generates the PDF with all the tabs, but my multi line text boxes are all blank. Whereas If I click on the default PDF button to generate the PDF they are are complete.
This is the code for the click properties of the button fd.exportToPDF('FileName');
Is it a Plain or Rich text field? If it is Rich Text field, it's content cannot be exported to PDF due to how the field is setup. You can export it on Display form when the field is in read-only mode. Or copy value from Rich Text field to HTML control, hide Rich Text field, and only show the control in PDF export. This is done with CSS.
Thanks Margarita,
I have the CSS for rich text working from the default button, but not on my custom button.
My custom button was only to make it more prominent as the pdf button is very modest
But after your reply a much easier solution dawned on me – just increase the size of the PDF button!
How stupid of me to not think of this in the first place.
.ms-Icon.ms-Icon--PDF {
font-size: 40px; /* Adjust this value to make the icon bigger /
width: 60px; / Adjust the width /
height: 60px; / Adjust the height */